1

We are using Elasticsearch 7.17.5 which is used by a Java 8 application. We are planning to upgrade to Elasticsearch 8.x.

Since High-level Rest Client is now deprecated I am unable to resolve dependencies in order to use the HLRC existing code with Elasticsearch Version 8.x.( High Level Client compatibilty with ES 8 )

Which version of elasticsearch-rest-high-level-client should we use?

Also do we need to migrate our java application to java 17?

sjsj15
  • 745
  • 6
  • 11

2 Answers2

1

Generally, you should start looking at the new Java API Client. Though it doesn't need to be immediately and you can also do a piece by piece migration if that makes it easier (see https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/migrate-hlrc.html).

For your specific problem:

Since High-level Rest Client is now deprecated I am unable to resolve dependencies in order to use the HLRC existing code with Elasticsearch Version 8.x

What's the dependency you cannot resolve? Because the old HLRC should be able to work with 8.x — quote from the documentation link you've posted:

The High Level Client version 7.16 and higher can communicate with Elasticsearch version 8.x after enabling API compatibility mode. When this mode is enabled, the client will send HTTP headers that instruct Elasticsearch 8.x to honor 7.x request/responses.

And the new Java API Client also supports JDK 8 or newer, see https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/installation.html.

xeraa
  • 10,456
  • 3
  • 33
  • 66
  • So for ES 8.0.1 version I am using org.elasticsearch.client elasticsearch-rest-high-level-client 7.17.1 dependency, which gives errors related to org.apache.lucene.search library. I tried with HLRC version 7.17.5 as well but no luck – sjsj15 Jul 05 '22 at 05:28
0

If you have ElasticSearch (Version 8.x) running externally and have a java application communicating with it using elasticsearch clients. The only change you have to do is during the client initialization and that is to enable the compatibility mode and all things should work correctly. I am assuming that all three of your dependencies regarding the HLRC are of the same version. The ElasticSearch Server,High level rest client and the Rest Client.