Which elastic api should use for the newer version v8.9 and rest high level client is not present in that version

155 Views Asked by At

Exception in thread "main" java.lang.NoSuchMethodError: org.elasticsearch.client.RestHighLevelClient.(Lorg/elasticsearch/client/RestClient;Lorg/elasticsearch/core/CheckedConsumer;Ljava/util/List;Ljava/lang/Boolean;)V at org.elasticsearch.client.RestHighLevelClientBuilder.build(RestHighLevelClientBuilder.java:53)

I tried to change the version of the elastic in pom.xml file.

1

There are 1 best solutions below

0
imotov On

It is hard to say what you are trying to do based on your question. It would have helped me to help you better if you specified which version you are migrating from, showed the relevant fragment of your pom.xml file and the code that generates this error.

In general the old style High Level Rest Client (HLRC) has been removed and no longer shipped with v8.x. Saying this, you can still use HLRC from v7.17 if you enable compatibility mode.

However, since HLRC has been deprecated for a while and has been removed in 8.x, you should probably consider migrating to the new Java API Client. Check the migration strategy for more information https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/migrate-hlrc.html