yoav
yoav

Reputation: 83

ElasticSearch Search After API - Index State

Is there any way to prevent the previous search results to be returned from the search after API? I want to prevent the same document returning twice...(this could happen if the document was updated between search after API calls)

Upvotes: 1

Views: 1283

Answers (1)

alr
alr

Reputation: 1804

The search_after functionality does not protect you from this, as each search is independent from the previous one and thus can change if you indexed or deleted documents in between.

if you need a guaranteed stable point in time snapshot of your data, you should use a scroll search. However this needs some resources (like open file handles) and thus should only be used for system administrative tasks but not for regular user search (of which you have many, this should not be used for every search).

Upvotes: 2

Related Questions