gpt4 book ai didi

elasticsearch - 创建索引- Elasticsearch -Java API

转载 作者:行者123 更新时间:2023-12-02 23:06:22 24 4
gpt4 key购买 nike

我正在尝试使用Elastic Search Java API创建索引。

我的代码与此类似:

String indexName = "clients";
Node node = new NodeBuilder().clusterName(this.clusterName).client(true).node();
Client client = node.client();

client.admin().indices().prepareCreate(indexName).execute().actionGet(); // It fails here

if (client != null) client.close();
if (node != null) node.close();

但是每次执行时,我都会收到此错误: http://screencast.com/t/MfnTccwho

我究竟做错了什么?

最佳答案

看起来Elasticsearch客户端版本和Elasticsearch服务器版本之间不匹配。

关于elasticsearch - 创建索引- Elasticsearch -Java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10607391/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com