Clear scroll with slices

Hi all,

I am trying to use the Scroll Rest API and I had a doubt that was resolved here:

However, when using slices, what does the last scroll_id mean? I have play around with the API and I saw that, by calling the Clear Scroll API with any id among all the scrolls in the same context(or search) the result is the same: search invalidation and not longer results can be retrieved. Then, it is mandatory to use "the last scroll id" or can be used any of them? (for instance the first returned by the initial search request)




I use the last given scroll Id passed to the next scroll request. And, at the end of all scroll, I delete the last given scroll id.

The initial search request and each subsequent scroll request each return a _scroll_id . While the _scroll_id may change between requests, it doesn’t always change — in any case, only the most recently received _scroll_id should be used.


Hi Xavi,

I understood your strategy, thanks a lot. The point is that I did some testing and I realized that, by using any of the scroll_id's was enough, I mean, the context search was cleared. It would be "nicer" for me to use the first scroll_id(just because I am using some stream library that fits better with this approach). That is why I am asking, just to confirm.



1 Like

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