# Aggregations query not returning response on Elasticsearch 7.5

**URL:** <https://discuss.elastic.co/t/aggregations-query-not-returning-response-on-elasticsearch-7-5/235544>\
**Category:** Elasticsearch\
**Created:** [June 3, 2020, 12:09pm UTC](https://discuss.elastic.co/t/aggregations-query-not-returning-response-on-elasticsearch-7-5/235544 "2020-06-03T12:09:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [June 3, 2020, 12:09pm UTC](https://discuss.elastic.co/t/aggregations-query-not-returning-response-on-elasticsearch-7-5/235544/1 "2020-06-03T12:09:15Z")

</div>

Hi, I am trying to run an ES query based on aggregations. It runs and returns a response in ES 2.4 but when I try to run the query in ES 7.5, it returns a response with empty buckets. Below is my query:

Elasticsearch 7.5 query

```auto
GET index_name/_search
{
     "aggs": {
            "category": {
                "nested": {
                    "path": "model.model_info"
                },
                "aggs": {
                    "tags": {
                        "terms": {
                            "field": "model.model_info.tags.raw",
                            "size": 1000
                        }
                    },
                    "sort_price_type": {
                        "terms": {
                            "field": "model.model_info.price_type",
                            "size": 100
                      }
                    }
                }
            }
     }
}

```

Response in Elasticsearch 7.5

```auto
{
   "took": 14,
   "timed_out": false,
   "_shards": {
      "total": 1,
      "successful": 1,
      "skipped": 0,
      "failed": 0
   },
   "hits": {
      "total": {
         "value": 0,
         "relation": "eq"
      },
      "max_score": null,
      "hits": []
   },
   "aggregations": {
      "category_data": {
         "doc_count": 0,
         "tags": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
         },
         "price_type": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
         }
      }
   }
}

```

For Elasticsearch 2.4 query works very well and looks is like this:

```auto
GET index_name/doc_type/_search
{
     "aggs": {
            "category": {
                "nested": {
                    "path": "model.model_info"
                },
                "aggs": {
                    "tags": {
                        "terms": {
                            "field": "model.model_info.tags.raw",
                            "size": 1000
                        }
                    },
                    "sort_price_type": {
                        "terms": {
                            "field": "model.model_info.price_type",
                            "size": 100
                      }
                    }
                }
            }
     }
}

```

I'm using the same mappings for both the queries:

```auto
"tags": map[string]interface{}{
    "type": "text",
    "fields": map[string]interface{}{
        "raw": map[string]interface{}{
	         "type": "keyword",
	         "index": true,
         },
     },
},
"price_type": map[string]interface{}{
		"type": "text",
		"fielddata": true,
},

```

Both `price_type` and `tags` are nested inside `model.model_info` fields.

It would be great if anyone can help me with this issue and make the queries run on both ES 2.4 and ES 7.5. I tried a lot to debug and make it work but still I'm not able to figure out my mistake. Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [June 4, 2020, 1:52am UTC](https://discuss.elastic.co/t/aggregations-query-not-returning-response-on-elasticsearch-7-5/235544/2 "2020-06-04T01:52:55Z")

</div>

It would be great if anyone can help me with issue, I'm still not able to fix it.

---

<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 2, 2020, 1:52am UTC](https://discuss.elastic.co/t/aggregations-query-not-returning-response-on-elasticsearch-7-5/235544/3 "2020-07-02T01:52:56Z")

</div>

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