How to connect java to local elastic search?


(Rajnikant) #1

i want to connect my local elastic search to java.


(Magnus B├Ąck) #2

https://www.elastic.co/guide/en/elasticsearch/client/index.html


(Rajnikant) #3

Thanks for give fast reply.
i already used this.
My Code is:
Node node = nodeBuilder()
.settings(ImmutableSettings.settingsBuilder().put("path.home", "/home/amit/elasticsearch-2.1.0/bin"))
.client(true)
.node();
Client client = node.client();

When i used "ImmutableSettings" in elasticsearch 2.1.1 then i got "ImmutableSettings cannot be resolved" this type of error.

Please help me out...


(Ivan Brusic) #4

Try using the TransportClient instead of the NodeBuilder

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html

Ivan


(system) #5