Different scroll id for each subsequent scroll request?

I am using scroll to fetch docs from elasticsearch, modify them, and reindex them. I have read everywhere and it is mentioned here and here that each subsequent request sends different scroll_id. But I don't see that happening. I get the same scroll_id which I got from the first request. Have I misunderstood anything?

This is possible, the docs are a bit misleading in suggesting that it's always different as there are situations where you might get the same one back. The scroll_id is a completely opaque internal identifier, don't try to read any meaning into it :slight_smile:

But I have never found the different scroll_id. Could you give me two different scenarios?

No, it's an implementation detail. Why does it matter to you?

I am fetching docs from elasticsearch using scroll. I need to know which scroll_id to pass in request body.

As per the docs you linked, you must always pass the scroll ID from the previous response.

Thanks. That seems a safe approach.

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