I tried creating a simple TransportClient in Java with elasticsearch 2.3.1 driver.
I followed instructions given on following link:
And also:
The problem I'm facing is following:
Settings settings = Settings.settingsBuilder()
.put("cluster.name", "myescluster")
.put("client.transport.sniff", true)
.build();
I get a message in my IntelliJIdea saying: cannot resolve method settingsBuilder
. My Settings class is import org.elasticsearch.common.settings.Settings;
.
I face similar situation in following code:
Client client = TransportClient.builder().build()
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host1"), 9300))
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host2"), 9300));
I get following error: cannot resolve method builder()
My TransportClient class is: import org.elasticsearch.client.transport.TransportClient;
Further, I'm using spring-boot and my maven entry for elasticsearch is as following:
<groupId>org.elasticsearch.distribution.tar</groupId>
<artifactId>elasticsearch</artifactId>
<version>2.3.1</version>
I need urgent help.