我安装了5.4.1版本,因为必须使用该版本。
我的服务器运行良好:
<div class="hero__description-right">
<li class="description__item">
<h2><span class="hashtag">#</span> Text</h2>
</li>
<li class="description__item test">
<h2><span class="hashtag">#</span> Text</h2>
</li>
<li class="description__item">
<h2><span class="hashtag">#</span> Text</h2>
</li>
</div>
这是我的Java代码:
{
"name" : "-0nx3wo",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "vxBcsrv9TXyUeLYFFVUkpQ",
"version" : {
"number" : "5.4.1",
"build_hash" : "2cfe0df",
"build_date" : "2017-05-29T16:05:51.443Z",
"build_snapshot" : false,
"lucene_version" : "6.5.1"
},
"tagline" : "You Know, for Search"
}
这是错误:
public class Connection {
public static void main(String[] args) throws UnknownHostException {
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(
new InetSocketTransportAddress(
InetAddress.getByName("localhost"), 9300));
client.close();
}
}
因此,看起来好像在调用no modules loaded
loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
loaded plugin [org.elasticsearch.script.mustache.MustachePlugin]
loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Exception in thread "main" java.lang.IllegalArgumentException: NamedWriteable [org.elasticsearch.index.query.QueryBuilder][has_child] is already registered for [org.elasticsearch.search.SearchModule$$Lambda$268/1558103808], cannot register [org.elasticsearch.join.ParentJoinPlugin$$Lambda$356/1560702077]
at org.elasticsearch.common.io.stream.NamedWriteableRegistry.<init>(NamedWriteableRegistry.java:91)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:150)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:268)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:128)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:114)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:104)
at Connection.main(Connection.java:15)
时出现了错误(由于行号addTransportAddress
),但老实说我无法解决我的问题。我检查了类似这样的主题(ElasticSearch TransportClient version 5.6),但没有一个帮助