Search code examples
spring-data-elasticsearchelasticsearch-7spring-boot-3elasticsearch-8

Can elasticsearch client version 8.X communicate with elasticsearch server version 7


I have 2 questions: 1: can elasticsearch client version 8 communicate with elasticsearch server version 7? 2: how to configure spring data elasticsearch version 5

first of all, can client elasticsearch version 8 communicate with elasticsearch server version 7? second, in my spring boot application version 3 i'm trying to configure spring data elasticsearch version 5 so i added the dependendy in pom.xml, then create my configuration class: ClientConfiguration like the documentation, but i don't found how to configure apiKey and index.name-suffix in application.yml . i already did this config:

spring:
  elasticsearch:
    uris: localhost:9200
    socket-timeout: 1000
    connection-timeout: 1000

Solution

  • To see how to configure Spring Data Elasticsearch and especially the client, check the official documentation.

    The properties you are referring to are not from Spring Data Elasticsearch but from Spring Boot. To see which properties exist check the Spring Boot documentation. I don't know which of these properties Spring Boot uses to configure Spring Data Elasticsearch and which they use for configuring a standalone Elasticsearch client.

    As for accessing an old cluster in version 7, you might try and set the compatibility headers (see thethe documentation, but as far as I know this does not guarantee full compatibility. I remember from the migration phase to the new client and version 8, that even though these headers were set, the client in version 8 was not always sending the correct values or able to parse the version 7 answers.