[Springboot]Rest High Level Client 7.0 can't use search method, missing org.elasticsearch.action.search.SearchRequest


I use Elasticsearch 7.0 (Latest Release) fresh new installing scratch without any upgrade from previous version. But I confront the problem when I try to use searching method.
It said that can't find org.elasticsearch.action.search.SearchRequest.
Spring Boot: 2.1.3.
Elasticsearch: 7.0
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-getting-started-maven.html

I had try to build project in Docker it seem likely to have same problem again


But after I down grade my High Level Rest Client to 6.6.2 it seem work pretty good , no more missing org.elasticsearch.action.search.SearchRequest So if anyone have problem like this I suggest you downgrade the client version.

But still confuse about why maven repository keep pulling 6.4.3 version all the time even in the Docker build.

When using springboot with
elasticsearch, you need to be explicit with some transitive dependencies as SpringBoot declares a version 6.4...

Basically you can put this in your pom.xml:

<properties>
  <elasticsearch.version>7.0.0<elasticsearch.version>
</properties>

See documentation here: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-customize-dependency-versions

1 Like

Thank you very much you are my life saver !!!
After add properties just like you said it work perfectly :slight_smile:
Thank you again !

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