# How to store elastisearch data in order?

**URL:** <https://discuss.elastic.co/t/how-to-store-elastisearch-data-in-order/20519>\
**Category:** Elasticsearch\
**Created:** [October 31, 2014, 2:51pm UTC](https://discuss.elastic.co/t/how-to-store-elastisearch-data-in-order/20519 "2014-10-31T14:51:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![satheesh\_kumar](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@satheesh\_kumar](https://discuss.elastic.co/u/satheesh_kumar)\
**Post date:** [October 31, 2014, 2:51pm UTC](https://discuss.elastic.co/t/how-to-store-elastisearch-data-in-order/20519/1 "2014-10-31T14:51:35Z")

</div>

Hi,

Is it possible to store records in sorted order? I see the records are  
stored randomly.

\_index  
\_type  
\_id  
\_score  
empname

dept  
employee  
1  
1  
emp1  
dept  
employee  
5  
1  
emp5  
dept  
employee  
3  
1  
emp3  
dept  
employee  
2  
1  
emp2  
dept  
employee  
4  
1  
emp4

But I want the records stored in this order.

\_index  
\_type  
\_id  
\_score  
empname

dept  
employee  
1  
1  
emp1  
dept  
employee  
2  
1  
emp2  
dept  
employee  
3  
1  
emp3  
dept  
employee  
4  
1  
emp4  
dept  
employee  
5  
1  
emp5

Thanks

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0b096c36-4c50-40c4-b5f0-6d8bcc4fb048%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0b096c36-4c50-40c4-b5f0-6d8bcc4fb048%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [October 31, 2014, 6:08pm UTC](https://discuss.elastic.co/t/how-to-store-elastisearch-data-in-order/20519/2 "2014-10-31T18:08:39Z")

</div>

This is not supported yet, see  
[Indexing: index-time sorting · Issue #6720 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/6720).

I am not sure why you want records in order, but for your information it is  
possible to perform search-time sorting:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Fri, Oct 31, 2014 at 3:51 PM, satheesh kumar [cssatheesh@gmail.com](mailto:cssatheesh@gmail.com)  
wrote:

> Hi,
> 
> Is it possible to store records in sorted order? I see the records are  
> stored randomly.
> 
> \_index  
> \_type  
> \_id  
> \_score  
> empname
> 
> dept  
> employee  
> 1  
> 1  
> emp1  
> dept  
> employee  
> 5  
> 1  
> emp5  
> dept  
> employee  
> 3  
> 1  
> emp3  
> dept  
> employee  
> 2  
> 1  
> emp2  
> dept  
> employee  
> 4  
> 1  
> emp4
> 
> But I want the records stored in this order.
> 
> \_index  
> \_type  
> \_id  
> \_score  
> empname
> 
> dept  
> employee  
> 1  
> 1  
> emp1  
> dept  
> employee  
> 2  
> 1  
> emp2  
> dept  
> employee  
> 3  
> 1  
> emp3  
> dept  
> employee  
> 4  
> 1  
> emp4  
> dept  
> employee  
> 5  
> 1  
> emp5
> 
> Thanks
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/0b096c36-4c50-40c4-b5f0-6d8bcc4fb048%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0b096c36-4c50-40c4-b5f0-6d8bcc4fb048%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/0b096c36-4c50-40c4-b5f0-6d8bcc4fb048%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0b096c36-4c50-40c4-b5f0-6d8bcc4fb048%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5jeQdbo8kmg8TgaZkc\_ooDNjdJVV%3DwcmH4JEH3qOC3jg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5jeQdbo8kmg8TgaZkc_ooDNjdJVV%3DwcmH4JEH3qOC3jg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:52am UTC](https://discuss.elastic.co/t/how-to-store-elastisearch-data-in-order/20519/3 "2017-07-06T00:52:47Z")

</div>


