Description
The scroll API is no longer recommended for scanning all data in an index. The new recommended read pattern is to make use of the search after api in combination with a point in time.
Scrolled searches are less optimal than the search after api due to a combination of resource consumption concerns and their single-use read pattern. If a scroll operation succeeds on a server, but is ignored by a client due to a timeout, the state of the cursor on the server is now updated past the missed documents and cannot be rolled back to replay them. Instead a new scroll must be created.
Search after with PIT gives us some benefits over Scroll as well. Aside from the stable nature of reads from the API, it is compatible with composite aggregations, which is the basis for streaming aggregate results.