# How to save ordering for recreated index in search result

**URL:** <https://discuss.elastic.co/t/how-to-save-ordering-for-recreated-index-in-search-result/128830>\
**Category:** Elasticsearch\
**Created:** [April 20, 2018, 8:29am UTC](https://discuss.elastic.co/t/how-to-save-ordering-for-recreated-index-in-search-result/128830 "2018-04-20T08:29:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmanj](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@jmanj](https://discuss.elastic.co/u/jmanj)\
**Post date:** [April 20, 2018, 8:29am UTC](https://discuss.elastic.co/t/how-to-save-ordering-for-recreated-index-in-search-result/128830/1 "2018-04-20T08:29:50Z")

</div>

Hello. We need to storage items order in resulting search response after elasticsearch index is updating. Now we do this by sorting with \_doc value, but for same field values getting different result after recreating elasticsearch index (with same data and processing order). We using ES v 5.5. I know, that in 6.0 is possible to put documents on disc with some ordering, it can help me to garant order in search response? Or i must add special field "doc\_id" to all documents? How field \_doc is calculated in ES?

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [April 20, 2018, 4:18pm UTC](https://discuss.elastic.co/t/how-to-save-ordering-for-recreated-index-in-search-result/128830/2 "2018-04-20T16:18:36Z")

</div>

Hope this helps start you on the journey: [https://www.elastic.co/blog/index-sorting-elasticsearch-6-0](https://www.elastic.co/blog/index-sorting-elasticsearch-6-0)

---

<div class="post-metadata">

**Author:** ![jmanj](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@jmanj](https://discuss.elastic.co/u/jmanj)\
**Post date:** [April 23, 2018, 3:30am UTC](https://discuss.elastic.co/t/how-to-save-ordering-for-recreated-index-in-search-result/128830/3 "2018-04-23T03:30:44Z")

</div>

Thanks for the answer. Before I asked the question, I was read this article and wrote about this in question content. I do not need to improve perfomance, only save the order of documents after index recreating. Can this feature for version 6.0 will help me?

---

<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:** [May 21, 2018, 3:30am UTC](https://discuss.elastic.co/t/how-to-save-ordering-for-recreated-index-in-search-result/128830/4 "2018-05-21T03:30:46Z")

</div>

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