Java class ElasticsearchClient v. 7.17.8


Java doc for ElasticsearchClient v. 7.17.8 ElasticsearchClient (java-client 7.17.8 API) states that ElasticsearchClient is java class.

However using


In the jar elasticsearch-7.17.8.jar I see, that it is only interface (see below).
In the jar elasticsearch-rest-client-7.17.8.jar, this class/interface does not exists in any form.

What makes of course problems in using it, due to trivial compiler errors.
They state that I can not use it as it is documented e.g. on the page: Migrating from the High Level Rest Client

Question: what is wrong?

Thanks in advance for help and regards,

package org.elasticsearch.client;

import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.threadpool.ThreadPool;

public interface ElasticsearchClient {
    <Request extends ActionRequest, Response extends ActionResponse> ActionFuture<Response> execute(ActionType<Response> var1, Request var2);

    <Request extends ActionRequest, Response extends ActionResponse> void execute(ActionType<Response> var1, Request var2, ActionListener<Response> var3);

    ThreadPool threadPool();

I think you are confusing the 2 clients:

What do you want to do?
Use a Java client for a new project? Then just use the new client as explained here: Installation | Elasticsearch Java API Client [7.17] | Elastic


Exactly I need to migrate old code (deprecated) to the new one.
Thank you very much!
It seems to solve my problem and indeed I was confused myself by different imports.

Best regards,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.