# Different scroll id for each subsequent scroll request?

**URL:** https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580
**Category:** Elasticsearch
**Created:** [April 24, 2020, 6:21am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580 "2020-04-24T06:21:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![A\_google\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_google_user/32/46709_2.png) [@A\_google\_user](https://discuss.elastic.co/u/A_google_user)
#### Post date: [April 24, 2020, 6:21am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/1 "2020-04-24T06:21:51Z")

</div>

I am using [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-scroll.html) to fetch docs from elasticsearch, modify them, and reindex them. I have read everywhere and it is mentioned [here](https://www.elastic.co/guide/en/elasticsearch/guide/1.x/scan-scroll.html) and [here](https://discuss.elastic.co/t/clearing-a-scroll-during-scan-and-scroll/42080/2) 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?

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 24, 2020, 7:01am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/2 "2020-04-24T07:01:17Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![A\_google\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_google_user/32/46709_2.png) [@A\_google\_user](https://discuss.elastic.co/u/A_google_user)
#### Post date: [April 24, 2020, 9:31am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/3 "2020-04-24T09:31:15Z")

</div>

But I have never found the different scroll\_id. Could you give me two different scenarios?

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 24, 2020, 10:09am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/4 "2020-04-24T10:09:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![A\_google\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_google_user/32/46709_2.png) [@A\_google\_user](https://discuss.elastic.co/u/A_google_user)
#### Post date: [April 24, 2020, 11:35am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/5 "2020-04-24T11:35:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 24, 2020, 1:35pm UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/6 "2020-04-24T13:35:06Z")

</div>

> [@A\_google\_user](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![A\_google\_user](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_google_user/32/46709_2.png) [@A\_google\_user](https://discuss.elastic.co/u/A_google_user)
#### Post date: [April 27, 2020, 11:27am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/7 "2020-04-27T11:27:14Z")

</div>

Thanks. That seems a safe approach.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 25, 2020, 11:27am UTC](https://discuss.elastic.co/t/different-scroll-id-for-each-subsequent-scroll-request/229580/8 "2020-05-25T11:27:19Z")

</div>

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