Search code examples
spring-bootelasticsearchspring-data-elasticsearch

Elasticsearch client version


How to fix this issue? Spring boot version:2.4.5 I am using gradle and dependencies used related to elastic search are:

implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'

&

implementation 'co.elastic.clients:elasticsearch-java:7.17.3'

 2023-02-10 20:51:45.788  INFO 1 --- [main] o.s.d.elasticsearch.support.VersionInfo  : Version Spring Data Elasticsearch: 4.1.8
 2023-02-10 20:51:45.793  INFO 1 --- [main] o.s.d.elasticsearch.support.VersionInfo  : Version Elasticsearch Client in build: 7.9.3
 2023-02-10 20:51:45.794  INFO 1 --- [main] o.s.d.elasticsearch.support.VersionInfo  : Version Elasticsearch Client used: 7.9.3
 2023-02-10 20:51:45.795  INFO 1 --- [main] o.s.d.elasticsearch.support.VersionInfo  : Version Elasticsearch cluster: 8.6.1
 2023-02-10 20:51:45.795  WARN 1 --- [main] o.s.d.elasticsearch.support.VersionInfo  : Version mismatch in between Elasticsearch Client and Cluster: 7.9.3 - 8.6.1

Solution

  • The issue is a warning because the major version between the Elasticsearch client that is used and the Elasticsearch server do not match. Spring Data Elasticsearch was not tested and released against ES 8. So anything might happen - no guarantees.

    How to solve this? Upgrade your application to Spring Boot 3, that uses Spring Data Elasticsearch 5.0, which in turn uses Elasticsearch 8.6.

    Spring Data Elasticsearch 4.1 is out of maintenance since May 2021.