# While scrolling, does the scroll id change

**URL:** https://discuss.elastic.co/t/while-scrolling-does-the-scroll-id-change/308239
**Category:** Elasticsearch
**Created:** [June 27, 2022, 11:21am UTC](https://discuss.elastic.co/t/while-scrolling-does-the-scroll-id-change/308239 "2022-06-27T11:21:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sfaxianovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sfaxianovic/32/107616_2.png) [@sfaxianovic](https://discuss.elastic.co/u/sfaxianovic)
#### Post date: [June 27, 2022, 11:21am UTC](https://discuss.elastic.co/t/while-scrolling-does-the-scroll-id-change/308239/1 "2022-06-27T11:21:29Z")

</div>

Hi all,  
In the documentation

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/8/f8ed4100a57d5001b333c6c87db51ca3f27b2e1c.jpeg)

in the loop while the scrollId is erased each time  
My question is why this is done like that ? are the scrollId changes each time ? and if so why only clearing the last one?

Regards

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 28, 2022, 12:59am UTC](https://discuss.elastic.co/t/while-scrolling-does-the-scroll-id-change/308239/2 "2022-06-28T00:59:01Z")

</div>

It'd be helpful if you could please link to the documentation page that you are taking this from, so that we know exactly what you are referring to 🙂

---

<div class="post-metadata">

### Author: ![asafi](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@asafi](https://discuss.elastic.co/u/asafi)
#### Post date: [June 28, 2022, 7:10am UTC](https://discuss.elastic.co/t/while-scrolling-does-the-scroll-id-change/308239/3 "2022-06-28T07:10:46Z")

</div>

@warkolm he is talking about this example  
[Search Scroll API](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-search-scroll.html#java-rest-high-search-scroll-example)

---

<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: [July 26, 2022, 7:11am UTC](https://discuss.elastic.co/t/while-scrolling-does-the-scroll-id-change/308239/4 "2022-07-26T07:11:10Z")

</div>

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