# Not stable order for sorting

**URL:** <https://discuss.elastic.co/t/not-stable-order-for-sorting/17741>\
**Category:** Elasticsearch\
**Created:** [May 27, 2014, 7:12am UTC](https://discuss.elastic.co/t/not-stable-order-for-sorting/17741 "2014-05-27T07:12:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11151](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/11151/32/1290_2.png) [@11151](https://discuss.elastic.co/u/11151)\
**Post date:** [May 27, 2014, 7:12am UTC](https://discuss.elastic.co/t/not-stable-order-for-sorting/17741/1 "2014-05-27T07:12:46Z")

</div>

When we apply term aggregation and sort by min aggregation the result is  
not stable.  
Sort by values going great, but objects with the same values ​​do not have  
a permanent position.  
Example - we change the number of objects while objects with a value of 20  
and 30 begin to behave strangely:

1: 10  
2: 20  
3: 20  
4: 30  
6: 30

and

1: 10  
3: 20  
2: 20  
6: 30  
5: 30  
4: 30  
7: 40  
8: 40  
9: 40  
10: 40

Index isolated (ie, it does not get the new data). Can we prevent such  
situations?

--  
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/c57b254c-0026-44c3-88a6-856291be18a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c57b254c-0026-44c3-88a6-856291be18a1%40googlegroups.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, 1:26am UTC](https://discuss.elastic.co/t/not-stable-order-for-sorting/17741/2 "2017-07-06T01:26:47Z")

</div>


