從 4.0.x 升級到 4.1.x
本節描述了從 4.0.x 版本到 4.1.x 版本的破壞性變更,以及如何用新引入的特性替換已移除的特性。
已棄用特性
id 屬性的定義
透過將實體中的屬性命名為 id
或 document
來將其定義為 id 屬性的做法現已棄用,並將產生警告。請使用 @Id
註解來標記作為 id 屬性的屬性。
索引對映
在 ReactiveElasticsearchClient.Indices
介面中,updateMapping
方法已被棄用,推薦使用 putMapping
方法。它們的功能相同,但 putMapping
與 Elasticsearch API 中的命名更一致。
別名處理
在 IndexOperations
介面中,方法 addAlias(AliasQuery)
, removeAlias(AliasQuery)
和 queryForAlias()
已被棄用。新的方法 alias(AliasAction)
, getAliases(String…)
和 getAliasesForIndex(String…)
提供了更多功能和更清晰的 API。
父ID
從 Elasticsearch 6 版本起,父 ID 的使用已被移除。我們現在棄用相應的欄位和方法。
已移除特性
型別對映
@Document
註解和 IndexCoordinates
物件中的型別對映引數已被移除。它們在 Spring Data Elasticsearch 4.0 中已被棄用,且其值已不再使用。