# Clear scroll clarification

**URL:** https://discuss.elastic.co/t/clear-scroll-clarification/76596
**Category:** Elasticsearch
**Created:** [February 27, 2017, 9:43am UTC](https://discuss.elastic.co/t/clear-scroll-clarification/76596 "2017-02-27T09:43:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)
#### Post date: [February 27, 2017, 9:43am UTC](https://discuss.elastic.co/t/clear-scroll-clarification/76596/1 "2017-02-27T09:43:52Z")

</div>

Hi all,

Question about scroll and clear scroll:  
Ref: [https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-scroll.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-scroll.html)

The documentation says that

```
    The initial search request and each subsequent scroll request returns a new _scroll_id 
    — only the most recent _scroll_id should be used.

```

and

```
scrolls should be explicitly cleared as soon as the scroll is not being used anymore

```

**My question is**  
Does it mean that each loop can clear the previous scrollId, or do we have to call the clear API when everything is scrolled with the list of all scrollIds ?

thx !  
Xavier

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 27, 2017, 10:20am UTC](https://discuss.elastic.co/t/clear-scroll-clarification/76596/2 "2017-02-27T10:20:29Z")

</div>

Hey,

only clear the last scroll id after you are done, dont do that in between, as then your scroll would not work anymore.

--Alex

---

<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: [March 27, 2017, 10:20am UTC](https://discuss.elastic.co/t/clear-scroll-clarification/76596/3 "2017-03-27T10:20:40Z")

</div>

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