Here是一个重新索引的例子。但是,如果 date
字段在重新索引期间更新怎么办?在几次滚动请求之后,我需要设置从 date
到 now
的日期间隔。 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/