# How to set the order of aggregations

**URL:** <https://discuss.elastic.co/t/how-to-set-the-order-of-aggregations/242025>\
**Category:** Elasticsearch\
**Created:** [July 21, 2020, 12:36pm UTC](https://discuss.elastic.co/t/how-to-set-the-order-of-aggregations/242025 "2020-07-21T12:36:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitterhh](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@gitterhh](https://discuss.elastic.co/u/gitterhh)\
**Post date:** [July 21, 2020, 12:36pm UTC](https://discuss.elastic.co/t/how-to-set-the-order-of-aggregations/242025/1 "2020-07-21T12:36:52Z")

</div>

is it possible to set the order of aggregations in the response to be the same as they are added in the request?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 23, 2020, 12:35am UTC](https://discuss.elastic.co/t/how-to-set-the-order-of-aggregations/242025/2 "2020-07-23T00:35:40Z")

</div>

It might be possible to do this, but it's not something that exists currently. If you'd like to see it, then raising a feature request on GitHub is the best path.

Ultimately, JSON is non-deterministic in its ordering.

---

<div class="post-metadata">

**Author:** ![gitterhh](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@gitterhh](https://discuss.elastic.co/u/gitterhh)\
**Post date:** [July 27, 2020, 7:00am UTC](https://discuss.elastic.co/t/how-to-set-the-order-of-aggregations/242025/3 "2020-07-27T07:00:54Z")

</div>

> <https://github.com/elastic/elasticsearch/issues/60180>
>
> It will be helpful to have possibility to specify in which order to return the aggregations, for example to return aggregations...

---

<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:** [August 24, 2020, 7:10am UTC](https://discuss.elastic.co/t/how-to-set-the-order-of-aggregations/242025/4 "2020-08-24T07:10:00Z")

</div>

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