ElasticSearch X-pack客户端问题

问题:
在ElasticSearch中安装X-pack后,通过TransportClient进行访问时,需要实例化PreBuiltXPackTransportClient,因此需要加入相应的jar包文件来增加此类。

解决:
Maven构建项目的话:




elasticsearch-releases
https://artifacts.elastic.co/maven

true


false


...

...




org.elasticsearch.client
x-pack-transport
5.2.2

...

...

Gradle构建项目的话:
repositories {
/* ... Any other repositories ... */

// Add the Elasticsearch Maven Repository
maven {
url "https://artifacts.elastic.co/maven"
}
}

dependencies {
// Provide the x-pack jar on the classpath for compilation and at runtime
compile "org.elasticsearch.client:x-pack-transport:5.2.2"

/* ... */
}

你可能感兴趣的:(ElasticSearch X-pack客户端问题)