Aggregation Metadata

edit

You can associate a piece of metadata with individual aggregations at request time that will be returned in place at response time.

Consider this example where we want to associate the color blue with our terms aggregation.

{
    ...
    aggs": {
        "titles": {
            "terms": {
                "field": "title"
            },
            "meta": {
                "color": "blue"
            },
        }
    }
}

Then that piece of metadata will be returned in place for our titles terms aggregation

{
    ...
    "aggregations": {
        "titles": {
            "meta": {
                "color" : "blue"
            },
            "buckets": [
            ]
        }
    }
}