Is there a way to find out if response returned from Scroll request is last page?


(Ayush Sangani) #1

Hey all,

I'm using Scroll request extensively in my application. Do we have any way to find out if response from Scroll request is going to be the last page?

For example: Suppose my first request with scrolling enabled has limit=100 and number of results matching this query is 250.

First execution with search endpoint: It will return 100 results.
Second execution with scroll endpoint: It will again return 100 results.
Third execution with scroll endpoint: It will return 50 results.

Then I have to make one EXTRA request to check if there are anymore results with "XYZ" scroll_id.
As there is no way to find out limit set on first request from Scroll API.

I want to avoid making an extra request to ES.

Any insight on this issue would be helpful.

Thanks,
Ayush


(Ayush Sangani) #2

@Mark_Harwood Any input would be really helpful!


(system) #3