ElasticSearch Multiple Scrolls Java API ElasticSearch Multiple Scrolls Java API elasticsearch elasticsearch

ElasticSearch Multiple Scrolls Java API


After searching some more, I got the impression that this (same scrollId) is by design. After the timeout has expired (which is reset after each call Elasticsearch scan and scroll - add to new index).

So you can only get one opened scroll per index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html states:

Scrolling is not intended for real time user requests, but rather for processing large amounts of data, e.g. in order to reindex the contents of one index into a new index with a different configuration.

So it appears what I wanted is not an option, on purpose - possibly because of optimization.

Update
As stated creating multiple scrolls cannot be done, but this is only true when the query you use for scrolling is the same. If you scroll for, for instance, another type, index, or just another query, you can have multiple scrolls


You can scroll the same index in same time, this is what elasticsearch-hadoop does.

Just, don't forget that under the hood, an index is composed of multiple shards that own data, so you can scroll each shards in parallel by using:

.setPreference("_shards:1")