2

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.