Reputation: 75
Getting the below error while running spring boot version 3.0.0 application with elastic search.
Caused by: org.elasticsearch.ElasticsearchStatusException:
Elasticsearch exception [type=exception, reason=Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported]
I am trying to upgrade springboot from 2.6.9 to 3.0.x, which resulted in the above error for elastic search. (Prior to spring boot upgrade elasticsearch was working fine)
Version used before spring-boot upgrade
Version used after spring-boot upgrade
Upvotes: 1
Views: 4093
Reputation: 19471
I checked the code of Spring Data Elasticsearch why and under which circumstances this header is sent in version 5.0.0:
You are referencing a dependency of the RestHighLevelClient, but that code does not send this header, so you are probably reactive or using the new client. How is your client set up, which client class do you use?
The main problem however is that the version of Elasticsearch server you use is more than two years old (7.9.3 was released on October 22nd 2020) and does not understand this header. The last Spring Data Elasticsearch version using that Elasticsearch dependency was 4.1, 4.2 already was built against 7.12.0.
Upvotes: 1