# Scroll query with slice

**URL:** <https://discuss.elastic.co/t/scroll-query-with-slice/313331>\
**Category:** Elasticsearch\
**Created:** [August 31, 2022, 8:15am UTC](https://discuss.elastic.co/t/scroll-query-with-slice/313331 "2022-08-31T08:15:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philkpler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philkpler/32/110280_2.png) [@philkpler](https://discuss.elastic.co/u/philkpler)\
**Post date:** [August 31, 2022, 8:15am UTC](https://discuss.elastic.co/t/scroll-query-with-slice/313331/1 "2022-08-31T08:15:50Z")

</div>

Hello,

Can someone confirm me that when querying using the scroll api, with slices,  
it will be targeting the same "state/snapshot" of the index ?

As far as I know, to simplify, scroll allow to "freeze" a state of the index, and then paginate over it. So that if a new document is added during the pagination process, it will be ignored.

To work with scroll we first perform a regular search, adding scroll parameter, and we get a scroll\_id, then we switch to the scroll api with that id to get the other results pages.

Now when it's about using slices, how Elasticsearch can know, internally, that it must target the same "frozen" state of the index ?  
Because if I want 2 slices, I'll have 2 perform 2 distinct search query with distinct slice id, retrieve 2 distinct scroll id, and then process the next pages using scroll API with those 2 ids...

Thanks

---

<div class="post-metadata">

**Author:** ![Emna\_Jaoua](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emna_jaoua/32/110281_2.png) [@Emna\_Jaoua](https://discuss.elastic.co/u/Emna_Jaoua)\
**Post date:** [September 8, 2022, 12:23pm UTC](https://discuss.elastic.co/t/scroll-query-with-slice/313331/2 "2022-09-08T12:23:45Z")

</div>

Hello, any updates on this please as it's not very clear in the documentation.

---

<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:** [October 6, 2022, 12:24pm UTC](https://discuss.elastic.co/t/scroll-query-with-slice/313331/3 "2022-10-06T12:24:29Z")

</div>

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