# Can I disable the sorting feature in Elasticsearch's aggregation

**URL:** <https://discuss.elastic.co/t/can-i-disable-the-sorting-feature-in-elasticsearchs-aggregation/52012>\
**Category:** Elasticsearch\
**Created:** [June 7, 2016, 2:11am UTC](https://discuss.elastic.co/t/can-i-disable-the-sorting-feature-in-elasticsearchs-aggregation/52012 "2016-06-07T02:11:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daqing\_Tian](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@Daqing\_Tian](https://discuss.elastic.co/u/Daqing_Tian)\
**Post date:** [June 7, 2016, 2:11am UTC](https://discuss.elastic.co/t/can-i-disable-the-sorting-feature-in-elasticsearchs-aggregation/52012/1 "2016-06-07T02:11:31Z")

</div>

As In my case, the bucket size can be as long as millions, and end-user just wants the bucket size instead of the bucket contents. As ES will always return the bucket ordered by doc\_count,this content is not I want and very time-consuming.  
I've already used the response filtering to just receive the bucket size, but still the query is too slow. Can I just turn off the sorting in the ES's aggregation and speed up my query?

---

<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, 10:45pm UTC](https://discuss.elastic.co/t/can-i-disable-the-sorting-feature-in-elasticsearchs-aggregation/52012/2 "2017-07-05T22:45:50Z")

</div>


