I am trying to use Jest Client for REST calls for elastic search. I am getting the following error in line JestClient client = factory.getObject();
:
Exception in thread "main" java.lang.NoSuchMethodError: io.searchbox.client.config.HttpClientConfig.isRequestCompressionEnabled()Z at io.searchbox.client.JestClientFactory.getObject(JestClientFactory.java:51) at JestTest.main(JestTest.java:22)
Following is the code:
JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder("http://localhost:9200")
.multiThreaded(true)
.build());
JestClient client = factory.getObject();
How can fix this error?