5

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 2

12

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.

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

Comments

0
POST /your_index/_search?search_type=scan
{    
    "scroll:" "1M"
    "query": { "match_all": {}},
    "size":  100    
}

This should also work. Putting the scroll into the braces. Will be neater for reading later.

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.