How do I increase the scroll size of my ES scroll search query? The default appears to be 50 hits, but I would like to increase that to 100 or so. I cannot find a reference to adjusting the scroll window size in the documentation.
2 Answers
In your initial scan search request, simply specify the size parameter with how many documents you'd like each scroll request to return, e.g. 100:
POST /your_index/_search?search_type=scan&scroll=1m
{
"query": { "match_all": {}},
"size": 100
}
or more simply
GET /your_index/_search?search_type=scan&scroll=1m&size=100
Also note that you will get more than 100 documents back, because the size is per-shard, so if you really want only 100 docs per batch and your have (e.g.) 5 shards per index, simply use size: 20, it'll do.