# Scroll Request with Condition

**URL:** <https://discuss.elastic.co/t/scroll-request-with-condition/120747>\
**Category:** Elasticsearch\
**Created:** [February 21, 2018, 12:39am UTC](https://discuss.elastic.co/t/scroll-request-with-condition/120747 "2018-02-21T00:39:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [February 21, 2018, 12:39am UTC](https://discuss.elastic.co/t/scroll-request-with-condition/120747/1 "2018-02-21T00:39:48Z")

</div>

Let's say my Scroll request contains a condition / filter that matches 100 documents. Once I start scrolling, say there was one more record added to the index that meets the condition / filter passed in the scroll request.

Would the scroll result include that new document that was added before the scroll completed? Basically, would it return 100 or 101 documents?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 21, 2018, 7:26am UTC](https://discuss.elastic.co/t/scroll-request-with-condition/120747/2 "2018-02-21T07:26:16Z")

</div>

> The results that are returned from a scroll request reflect the state of the index at the time that the initial search request was made, like a snapshot in time. Subsequent changes to documents (index, update or delete) will only affect later search requests.

As outlined in. [the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-request-scroll.html), it works on a snapshot, so would return 100 documents.

---

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [February 21, 2018, 3:55pm UTC](https://discuss.elastic.co/t/scroll-request-with-condition/120747/3 "2018-02-21T15:55:46Z")

</div>

Awesome, thank you for the confirmation.

Just curious, what happens to Create, Index and Delete operations while scroll is in progress? How are these handled under the hood?

---

<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 21, 2018, 3:55pm UTC](https://discuss.elastic.co/t/scroll-request-with-condition/120747/4 "2018-03-21T15:55:57Z")

</div>

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