如何使用elasticsearch术语聚合获得额外的字段值?这是我的查询字符串
"aggs":{
"group_by_ruleSets":{
"terms":{
"size":100,
"field":"alert.ruleSets",
"order":{
"_count":"desc"
}
}
}
}
这是弹性搜索返回结果:
"aggregations": { "terms_group_by": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "10457", "doc_count": 2 } ] } } }
这是我想要的结果:
"aggregations": { "terms_group_by": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "10457", "doc_count": 2 "setName":"Test RuleSet" } ] } } }
字段" setName"有弹性研究。