【发布时间】:2019-05-15 17:21:38
【问题描述】:
假设我有两个 aggs:
GET .../_search
{
"size": 0,
"aggs": {
"foo": {
"terms": {
"field": "foo"
}
},
"bar": {
"terms": {
"field": "bar"
}
}
}
}
返回以下内容:
...
"aggregations": {
"foo": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "Africa",
"doc_count": 23
}
]
},
"bar": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "Oil",
"doc_count": 23
}
]
}
}
我的问题是,我怎么知道“foo”和“bar”聚合是否聚合了相同的 23 个文档?
我尝试在 "foo" 和 "bar" aggs 中添加一个子 agg 来对任意数字字段求和,但这并不是万无一失的。
【问题讨论】:
标签: elasticsearch