Specifying size in Scroll API

I want to use scroll for my pagination. I know that in the initial search request I can specify the "size",
Is it possible to specify the size in the subsequent scroll requests.
My use case is like this
In first batch get 10
In second batch get 10
In third batch I want to get only 5

Is there any way to tell scroll API that I want these many records only?

I don't see such an option.
But you can always get the 10 results back on the 3rd request and in your application just get the 5 first you need.

Why use scroll queries for pagination of small result sets? Each scroll query will keep a context that has a certain lifetime and puts a hold on the underlying segments, potentially preventing merging.

That was just example. Actually we want to get in batches of 50k

Ok. thanks.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.