indexing - elasticsearch中的滚动如何处理不断更新的数据?

标签 indexing scroll elasticsearch reindex

Here是一个重新索引的例子。但是,如果 date 字段在重新索引期间更新怎么办?在几次滚动请求之后,我需要设置从 datenow 的日期间隔。 elasticsearch 滚动如何处理这种情况:它只是滚动具有旧 date 值的文档还是永远滚动直到更新请求结束?

最佳答案

扫描和滚动 API 的工作方式在距您的链接一个链接处进行了描述,即 http://www.elastic.co/guide/en/elasticsearch/guide/master/scan-scroll.html

在该页面上,指出

A scrolled search takes a snapshot in time — it doesn’t see any changes that are made to the index after the initial search request has been made. It does this by keeping the old datafiles around, so that it can preserve its “view” on what the index looked like at the time it started.

因此,这意味着无论您使用特定日期作为结束日期还是简单地使用现在,都不会产生任何区别,因为滚动查询所考虑的文档快照将在查询运行的整个过程中始终保持不变。

假设您现在正在发出滚动查询(例如在 2015-05-11 06:22:27),那么在该日期之后将不会返回任何为您的索引贡献的新文档。

关于indexing - elasticsearch中的滚动如何处理不断更新的数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30153244/

相关文章:

MATLAB - 给定索引矩阵置换矩阵的列

sql - 在 Oracle 中强制使用索引

Javascript 滚动不会停止

elasticsearch - Kibana 4 自定义仪表板

python-3.x - Elasticsearch Python 中的批量(助手)索引错误

mongodb - 错误 : text index required for $text query

mongodb - 在 Mongodb 中,如何不受限制地获取返回的总结果数?

javascript - 幻灯片内的 ionic ListView

jquery - 通过鼠标滚轮滚动到下一页

elasticsearch - 在Google Cloud Kubernetes上运行elasticsearch以CrashLoopBackOff结尾