Search code examples
javaspring-bootelasticsearchspring-data-elasticsearch

How to specify a newer version of Elasticsearch in spring-boot


How to specify a newer version of Elasticsearch in spring-boot for the following library. This needs to be a gradle dependency

compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch', version: '2.3.4.RELEASE'

    say 7.9.1 instead of 7.6.2

Will it work against a newer version?


Solution

  • You don't need to update your application to a newer version if you do not use some native Elasticsearch library stuff in your application which is not available in 7.6.2.

    Spring Data Elasticsearch 4.0.4 (pulled in by Spring Boot 2.3.4) is built with the Elasticsearch client libraries in version 7.6.2, but these client libraries can communicate with an Elasticsearch cluster in version 7.9.1, there were no changes in the client communication protocol as far as I know.

    You will get a warning in the log:

    WARN [main] o.s.d.elasticsearch.support.VersionInfo : Version mismatch in between Elasticsearch Client and Cluster: 7.6.2 - 7.9.1

    but you can ignore that.