如何使用Spring-Data-Elasticsearch在ES中实现索引翻转属性/条件
使用Spring-Data-elasticsearch时,如何在弹性搜索中添加以下属性值?
- 您想将新索引的最大尺寸或年龄。
- 索引不再更新并可以减少主碎片的数量的点。
- 何时迫使合并以永久删除标记为删除的文件。
- 索引可以转移到性能较低的硬件的点。
- 可用性并不那么关键的点,并且可以减少复制品的数量。
- 当索引可以安全删除时。
当前,我使用以下方式创建动态索引名称:
@document(indexName =“#{ @esconfig.getIndexName()}”,shards = 1,replicas = 0,refreshinterval =“ 5S”,createIndex = false)
How can I add the following property values in elastic search when using spring-data-elasticsearch?
- The maximum size or age at which you want to roll over to a new index.
- The point at which the index is no longer being updated and the number of primary shards can be reduced.
- When to force a merge to permanently delete documents marked for deletion.
- The point at which the index can be moved to less performant hardware.
- The point at which the availability is not as critical and the number of replicas can be reduced.
- When the index can be safely deleted.
Currently, I creating dynamic index name using:
@Document(indexName = "#{@esConfig.getIndexName()}", shards = 1, replicas = 0, refreshInterval = "5s", createIndex = false)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spring Data Elasticsearch目前不支持索引生命周期动作。
您需要使用Elasticsearch Client提供的功能来实现此功能。
Index lifecycle Actions are currently not supported in Spring Data Elasticsearch.
You'd need to implement this using the functions that the Elasticsearch client offers.