Here is an example with reindexing. But what if date
field is updating during reindex? And after several scroll requests I need to set date inteval from date
to now
. How elasticsearch scroll handle this situation: it just scroll documents with old date
value or scroll forever untill update requests ends?

- 31,309
- 66
- 224
- 364
1 Answers
The way the scan-and-scroll API works is described one link away from your link, i.e. at http://www.elastic.co/guide/en/elasticsearch/guide/master/scan-scroll.html
On that page, it's stated that
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.
So what this implies is that whether you use a specific date for your end date or simply now
, it won't make any difference since the snapshot of documents taken into account by your scroll query will always be constant during the whole time the query runs.
Say you're issuing a scroll query right now (e.g. at 2015-05-11 06:22:27), then no new documents contributed to your index after that date will ever be returned.

- 207,596
- 13
- 358
- 360