Upgrading from 5.0.x to 5.1.x

This section describes breaking changes from version 5.0.x to 5.1.x and how removed features can be replaced by new introduced features.spring-doc.cn

Breaking Changes

In the org.springframework.data.elasticsearch.core.index.AliasData class, which is used for alias information returned from Elasticsearch, the property filter (of type Document) is replaced by filterQuery which is of type org.springframework.data.elasticsearch.core.query.Query.spring-doc.cn

org.springframework.data.elasticsearch.annotations.Similarity was an enum class until 5.1. This enum was used in the @Field annotation to specify a similarity value. But besides the values defined by the enum, it is possible to have similarities with custom names in Elasticsearch. Therefore, the annotation property was changed from the type of the enum to a simple String. The previous enum values like Similarity.Default do still exist as String constants, so existing code will compile unmodified. Adaptions are necessary when this enum was used at other places than as a property of the @Field annotation.spring-doc.cn

Deprecations

template functions

The functions in the IndexOperations and ReactiverIndexOperations to manage index templates that were introduced in Spring Data Elasticsearch 4.1 have been deprecated. They were using the old Elasticsearch API that was deprecated in Elasticsearch version 7.8.spring-doc.cn

Please use the new functions that are based on the composable index template API instead.spring-doc.cn