通过使用以下查询进行条件聚合:
{ "size": 0, "filter": { "term": { "field1": "value" } }, "aggregations": { "field2" : { "terms" : { "field" : "field2" } } } }
相似问题