# Aggregations sorting (between them, not in their results) changes from ES7 to ES8?

**URL:** <https://discuss.elastic.co/t/aggregations-sorting-between-them-not-in-their-results-changes-from-es7-to-es8/361659>\
**Category:** Elasticsearch\
**Created:** [June 18, 2024, 3:01pm UTC](https://discuss.elastic.co/t/aggregations-sorting-between-them-not-in-their-results-changes-from-es7-to-es8/361659 "2024-06-18T15:01:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samyrabih](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samyrabih/32/122056_2.png) [@samyrabih](https://discuss.elastic.co/u/samyrabih)\
**Post date:** [June 18, 2024, 3:01pm UTC](https://discuss.elastic.co/t/aggregations-sorting-between-them-not-in-their-results-changes-from-es7-to-es8/361659/1 "2024-06-18T15:01:52Z")

</div>

Hi !  
In our application, we use aggregations using this kind of syntax:

```auto
"aggs": {
    "question_1.answer.id": {
      "terms": {
        "field": "question_1.answer.id",
        "size": 20000
      },
      "aggs": {
        "id": {
          "terms": {
            "field": "id",
            "size": 20000
          }
        }
      }
    },
    "question_2.answer.id": {
      "terms": {
        "field": "question_2.answer.id",
        "size": 20000
      },
      "aggs": {
        "id": {
          "terms": {
            "field": "id",
            "size": 20000
          }
        }
      }
    },
    "question_3.answer.id": {
      "terms": {
        "field": "question_3.answer.id",
        "size": 20000
      },
      "aggs": {
        "id": {
          "terms": {
            "field": "id",
            "size": 20000
          }
        }
      }
    },

```

In ES7, the aggregations in the result were ordered by a strange order (question\_99, question\_16, etc)  
In ES8, the aggregations names are "naturally" ordered (question\_1, question\_2, etc)

Is it a setting in configuration ?

Thanks
