Can the name of the bucket aggregation key name be modified?

Hi There,

Can the name of the bucket aggregation key name be modified?

I was looking through the documentation and Google and could not find a way to modify the name of the key returned in the aggregation results. Ideally I would want the results to include the key of the item it represents. In this case "key" --> "circuit.type.id"

Thanks,

Mark

"buckets": [
    {
      "key": 120,
      "doc_count": 14538,
      "sum_kwh": {
        "value": 682.5138338960242
      }
    },
    {
      "key": 111,
      "doc_count": 29229,
      "sum_kwh": {
        "value": 192.03866659135383
      }
    }
  ]
}

You can't modify the key, but you can add metadata: https://www.elastic.co/guide/en/elasticsearch/reference/current/agg-metadata.html