多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# Aggregation Metadata(聚合元数据) 原文链接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/agg-metadata.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/agg-metadata.html) 译文链接 : [Aggregation Metadata(聚合元数据)](/pages/viewpage.action?pageId=10030356) 贡献者 : [程威](/display/~chengwei),[ApacheCN](/display/~apachecn),[Apache中文网](/display/~apachechina) 您可以将一条元数据与请求时的各个聚合相关联,并一起返回。 考虑这个例子,我们想将颜色蓝色与我们的 **terms **聚合相关联。 ``` curl -XGET 'localhost:9200/twitter/tweet/_search?pretty' -H 'Content-Type: application/json' -d' { "size": 0, "aggs": { "titles": { "terms": { "field": "title" }, "meta": { "color": "blue" } } } } ' ``` ``` 那么这个元数据将被返回到我们的标题术语聚合 ``` ``` { "aggregations": { "titles": { "meta": { "color" : "blue" }, "doc_count_error_upper_bound" : 0, "sum_other_doc_count" : 0, "buckets": [ ] } }, ... } ```