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\": {
ES has no way of knowing agency_name
and agency_code
map one-to-one. Therefore I would recommend a number of possible strategies.
agency_name
and use the term agg over that field. I would be surprised if you actually need to do tokenization of the agency_name
.As Aditya Patel mentioned above, parent child relationships may help out as well but I believe you will still have to use one of the above strategies to resolve the id->name mapping.