# Does sorting by \_doc remain consistent during paging

**URL:** <https://discuss.elastic.co/t/does-sorting-by-doc-remain-consistent-during-paging/314178>\
**Category:** Elasticsearch\
**Created:** [September 12, 2022, 9:48am UTC](https://discuss.elastic.co/t/does-sorting-by-doc-remain-consistent-during-paging/314178 "2022-09-12T09:48:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel-kr](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@daniel-kr](https://discuss.elastic.co/u/daniel-kr)\
**Post date:** [September 12, 2022, 9:48am UTC](https://discuss.elastic.co/t/does-sorting-by-doc-remain-consistent-during-paging/314178/1 "2022-09-12T09:48:08Z")

</div>

Hey,

I want to page through my search results by using the parameters `from` and `size` (no scrolling or search after API with PIT involved).

I don't care about the sort order of the whole result set. Therefore, I sort by `_doc` because I read [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/sort-search-results.html) that this is the most efficient way if the order doesn't matter.

However, I wonder about the consistency during paging through the result set.

Is the order consistent during paging if the following conditions are met?

1. The result set of the search does not change during paging
2. However, other documents, that are not part of the result set, might change during paging

I searched for the question on the internet but did not find any satisfying answer to it.

Maybe one of you can answer this question.

Thanks in advance!

Regards,  
Daniel

---

<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 10, 2022, 9:48am UTC](https://discuss.elastic.co/t/does-sorting-by-doc-remain-consistent-during-paging/314178/2 "2022-10-10T09:48:10Z")

</div>

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