The Java High Level REST Client is supposed to be compatible with v8 in compatibility mode, but the API public RefreshResponse refresh(RefreshRequest refreshRequest, RequestOptions options) can no longer work if RefreshResponse is missing...right?
I understand that RequestResponse is on the server side but RHLC 7 claims to be compatible with server v8 (using compatibility mode). So I'd expect that a RHLC v7 API continues to work with server v8 libraries.
Secondly, why would RefreshRequest exist but not the RefreshResponse?
So you should either stay on the 7.17 HLClient (which I don't recommend)
ES docs actually outline a migration strategy wherein you continue to use the RHLC v7 until you can slowly switch over to the new java APIs which we're doing.
@swallez I'm not sure, but I don't think the class you linked to helps. The RHLC API uses org.elasticsearch.action.admin.indices.refresh.RefreshResponse but the elasticsearch-java class is in package co.elastic.clients.elasticsearch.indices meaning it's not the same one
It is indeed a different class. The RHLC and Java API client are different libraries that both allow calling the Elasticsearch API.
You can use both in an application, but for a single API call you have to use one or the other. In other words, calling the refresh API with the RHLC will give you a RHLC response.
Calling the refresh API with the Java API client will give you a Java API client response. They both have the same name, are distinct classes that live in different libraries and different packages.
I don't know where this expectation came from, but its definitely not what "compatible with" means.
The compatibility that is offered is that the HLRC can send JSON requests and receive JSON responses from an Elasticsearch 8.x server. It does not mean that the HLRC uses the server code, or that it is safe to use the HLRC on a classpath that has the 8.x server jars on it.
This thread was really motivated by upgrading out test infrastructure to use es8 and this thread is related to NPE Initializing PluginsService in ES8 - #3 by buitcj in that our test infra was relying embedded mode. If embedded mode is no longer supported then we don't need to have the es8 server libraries in the same process, and there shouldn't be a library conflict anymore. This now makes sense to me.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.