This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Data Elasticsearch 5.4.0!spring-doc.cn

Upgrading from 5.1.x to 5.2.x

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

Breaking Changes

Bulk failures

In the org.springframework.data.elasticsearch.BulkFailureException class, the return type of the getFailedDocuments is changed from Map<String, String> to Map<String, FailureDetails>, which allows to get additional details about failure reasons.spring-doc.cn

The definition of the FailureDetails class (inner to BulkFailureException):spring-doc.cn

public record FailureDetails(Integer status, String errorMessage) {
}

scripted and runtime fields

The classes org.springframework.data.elasticsearch.core.RuntimeField and org.springframework.data.elasticsearch.core.query.ScriptType have been moved to the subpackage org.springframework.data.elasticsearch.core.query.spring-doc.cn

The type parameter of the ScriptData constructor is not nullable any longer.spring-doc.cn

Deprecations

Removal of deprecated code

  • All the code using the old deprecated RestHighLevelClient has been removed. The default Elasticsearch client used since version 5.0 is the (not so) new Elasticsearch Java client.spring-doc.cn

  • The org.springframework.data.elasticsearch.client.ClientLogger class has been removed. This logger was configured with the org.springframework.data.elasticsearch.client.WIRE setting, but was not working with all clients. From version 5 on, use the trace logger available in the Elasticsearch Java client, see Client Logging.spring-doc.cn

  • The method org.springframework.data.elasticsearch.core.ElasticsearchOperations.stringIdRepresentation(Object) has been removed, use the convertId(Object) method defined in the same interface instead.spring-doc.cn

  • The class org.springframework.data.elasticsearch.core.Range has been removed, use org.springframework.data.domain.Range instead.spring-doc.cn

  • The methods org.springframework.data.elasticsearch.core.query.IndexQuery.getParentId() and `setParentId(String) have been removed, they weren’t used anymore and were no-ops. It has been removed from the org.springframework.data.elasticsearch.core.query.IndexQuery class as well.spring-doc.cn