# Sort aggregations order in response

**URL:** <https://discuss.elastic.co/t/sort-aggregations-order-in-response/24304>\
**Category:** Elasticsearch\
**Created:** [June 25, 2015, 6:53am UTC](https://discuss.elastic.co/t/sort-aggregations-order-in-response/24304 "2015-06-25T06:53:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vreen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vreen/32/3469_2.png) [@vreen](https://discuss.elastic.co/u/vreen)\
**Post date:** [June 25, 2015, 6:53am UTC](https://discuss.elastic.co/t/sort-aggregations-order-in-response/24304/1 "2015-06-25T06:53:04Z")

</div>

Hi,

I just wonder if I can have influence the order of the aggreated fields in the server response.

example:

```
{
"aggs": {
    "width": {
        "terms": {
            "field": "width"
        }
    },
    "height": {
        "terms": {
            "field": "height"
        }
    },
    "depth": {
        "terms": {
            "field": "depth"
        }
    },
    "material": {
        "terms": {
            "field": "material"
        }
    }
}}

```

In the response my fields are in a different order (depth, material, width, height).

Would be great if someone had a hint for me.

Cheers,  
Sascha

---

<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:05am UTC](https://discuss.elastic.co/t/sort-aggregations-order-in-response/24304/2 "2017-07-06T00:05:31Z")

</div>


