# Question about scrolling

**URL:** <https://discuss.elastic.co/t/question-about-scrolling/14091>\
**Category:** Elasticsearch\
**Created:** [October 24, 2013, 11:30am UTC](https://discuss.elastic.co/t/question-about-scrolling/14091 "2013-10-24T11:30:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![haizaar](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@haizaar](https://discuss.elastic.co/u/haizaar)\
**Post date:** [October 24, 2013, 11:30am UTC](https://discuss.elastic.co/t/question-about-scrolling/14091/1 "2013-10-24T11:30:55Z")

</div>

I want to fetch all the stored documents in ES and I see that there is a  
"scroll" search type to easily support this.

My question is - if during the scroll, another client updates a particular  
document that I did not fetch yet - will I get this document as it was when  
I've started the scroll or an updated one?  
In other words, does scroll create a snapshot of the data when it starts or  
returns the documents as they are when it reaches them?

Thanks,  
Zaar

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [October 24, 2013, 11:47am UTC](https://discuss.elastic.co/t/question-about-scrolling/14091/2 "2013-10-24T11:47:50Z")

</div>

Hi Zaar

It takes a snapshot of the index at the time the scrolled search starts. So  
any later changes don't change the results of the scroll.

Note: deep scrolling on a sorted result set becomes slower, the deeper you  
get. If you want to pull back lots of documents (eg for reindexing an  
index), then you should use search\_type=scan, which disables sorting and  
keeps deep scrolling performant

clint

On 24 October 2013 12:30, Zaar Hai [haizaar@gmail.com](mailto:haizaar@gmail.com) wrote:

> I want to fetch all the stored documents in ES and I see that there is a  
> "scroll" search type to easily support this.
> 
> My question is - if during the scroll, another client updates a particular  
> document that I did not fetch yet - will I get this document as it was when  
> I've started the scroll or an updated one?  
> In other words, does scroll create a snapshot of the data when it starts  
> or returns the documents as they are when it reaches them?
> 
> Thanks,  
> Zaar
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![haizaar](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@haizaar](https://discuss.elastic.co/u/haizaar)\
**Post date:** [October 24, 2013, 11:56am UTC](https://discuss.elastic.co/t/question-about-scrolling/14091/3 "2013-10-24T11:56:51Z")

</div>

Thanks Clinton!

These are excellent news.  
My dataset is relatively small and I still need sorting because I need  
documented returned ordered by their doc type (I have several dozens of doc  
types) - unless there is another efficient way to do it.

Thanks again.  
Zaar

On Thursday, October 24, 2013 2:47:50 PM UTC+3, Clinton Gormley wrote:

> Hi Zaar
> 
> It takes a snapshot of the index at the time the scrolled search starts.  
> So any later changes don't change the results of the scroll.
> 
> Note: deep scrolling on a sorted result set becomes slower, the deeper you  
> get. If you want to pull back lots of documents (eg for reindexing an  
> index), then you should use search\_type=scan, which disables sorting and  
> keeps deep scrolling performant
> 
> clint
> 
> On 24 October 2013 12:30, Zaar Hai \<[hai...@gmail.com](mailto:hai...@gmail.com) \<javascript:\>\> wrote:
> 
> > I want to fetch all the stored documents in ES and I see that there is a  
> > "scroll" search type to easily support this.
> > 
> > My question is - if during the scroll, another client updates a  
> > particular document that I did not fetch yet - will I get this document as  
> > it was when I've started the scroll or an updated one?  
> > In other words, does scroll create a snapshot of the data when it starts  
> > or returns the documents as they are when it reaches them?
> > 
> > Thanks,  
> > Zaar
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:10am UTC](https://discuss.elastic.co/t/question-about-scrolling/14091/4 "2017-07-06T02:10:50Z")

</div>


