# Index default sorting

**URL:** <https://discuss.elastic.co/t/index-default-sorting/32154>\
**Category:** Elasticsearch\
**Created:** [October 14, 2015, 9:19am UTC](https://discuss.elastic.co/t/index-default-sorting/32154 "2015-10-14T09:19:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpepermint](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xpepermint/32/5274_2.png) [@xpepermint](https://discuss.elastic.co/u/xpepermint)\
**Post date:** [October 14, 2015, 9:19am UTC](https://discuss.elastic.co/t/index-default-sorting/32154/1 "2015-10-14T09:19:55Z")

</div>

Hey. I need to use the `scroll & scan` command for retrieving a large set of data. Is there a way to set the `default index order` in which the documents would be sorted when indexing? Thus, the index would be a list of sorted documents by default and the `scan` command would return the list of documents sorted by `name`.

Thanks.

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [October 14, 2015, 5:04pm UTC](https://discuss.elastic.co/t/index-default-sorting/32154/2 "2015-10-14T17:04:06Z")

</div>

Hi, this is not possible afaik. Documents are not stored in any sorted order in ES, but can be sorted at search time. The whole point of `scan & scroll` is to gain speed by not doing sorting when retrieving large amounts of data. However, it is possible to just use the [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) without scan on a search, but this will likely suffer from the known problems for [deep pagination](https://www.elastic.co/guide/en/elasticsearch/guide/current/pagination.html).

---

<div class="post-metadata">

**Author:** ![xpepermint](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xpepermint/32/5274_2.png) [@xpepermint](https://discuss.elastic.co/u/xpepermint)\
**Post date:** [October 18, 2015, 10:29pm UTC](https://discuss.elastic.co/t/index-default-sorting/32154/3 "2015-10-18T22:29:59Z")

</div>

OK, thanks!

---

<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 5, 2017, 11:44pm UTC](https://discuss.elastic.co/t/index-default-sorting/32154/4 "2017-07-05T23:44:10Z")

</div>


