ElasticSearch - How to display an additional field name in aggregation query

前端 未结 5 1326
無奈伤痛
無奈伤痛 2021-02-12 03:51

How can I add a new key called \'agency_name\' in my output bucket.

I am running an aggregation code as shown below

{
  \"aggs\": {
    \"name\": {
             


        
5条回答
  •  一向
    一向 (楼主)
    2021-02-12 03:59

    This is old post, however, I ran into same issue and I followed what is given at https://www.elastic.co/guide/en/elasticsearch/reference/current/agg-metadata.html. Add metadata details and it is return as part of the result above bucket. Hope it will help someone in future.

提交回复
热议问题