_bucket_count 在 bucket_selector- 管道聚合中
_bucket_count in bucket_selector- pipeline aggregation
我正在努力完成这项工作,但运气不佳。这种语法应该有效吗?
我指的是这个 git 问题:
https://github.com/elastic/elasticsearch/pull/19571
谢谢!
GET index/type/_search?ignore_unavailable
{
"size": 0,
"aggs": {
"groupby_country": {
"terms": {
"field": "country",
"size": 2000
},
"aggs": {
"should_we_consider": {
"bucket_selector": {
"buckets_path": {
"hits": "groupby_domain.**_bucket_count**"
},
"script": "_bucket_count.hits>0"
}
},
"groupby_domain": {
"terms": {
"field": "domain",
"size": 2000
},
"aggs": {
"groupby_page": {
"terms": {
"field": "page",
"size": 2000,
"min_doc_count": 2
}
}
}
}
}
}
}
}
试试这个:
{
"size": 0,
"aggs": {
"groupby_country": {
"terms": {
"field": "country",
"size": 2000
},
"aggs": {
"should_we_consider": {
"bucket_selector": {
"buckets_path": {
"hits": "groupby_domain._bucket_count"
},
"script": "params.hits > 0"
}
},
"groupby_domain": {
"terms": {
"field": "domain",
"size": 2000
},
"aggs": {
"groupby_page": {
"terms": {
"field": "page",
"size": 2000,
"min_doc_count": 2
}
}
}
}
}
}
}
}
我正在努力完成这项工作,但运气不佳。这种语法应该有效吗? 我指的是这个 git 问题: https://github.com/elastic/elasticsearch/pull/19571
谢谢!
GET index/type/_search?ignore_unavailable
{
"size": 0,
"aggs": {
"groupby_country": {
"terms": {
"field": "country",
"size": 2000
},
"aggs": {
"should_we_consider": {
"bucket_selector": {
"buckets_path": {
"hits": "groupby_domain.**_bucket_count**"
},
"script": "_bucket_count.hits>0"
}
},
"groupby_domain": {
"terms": {
"field": "domain",
"size": 2000
},
"aggs": {
"groupby_page": {
"terms": {
"field": "page",
"size": 2000,
"min_doc_count": 2
}
}
}
}
}
}
}
}
试试这个:
{
"size": 0,
"aggs": {
"groupby_country": {
"terms": {
"field": "country",
"size": 2000
},
"aggs": {
"should_we_consider": {
"bucket_selector": {
"buckets_path": {
"hits": "groupby_domain._bucket_count"
},
"script": "params.hits > 0"
}
},
"groupby_domain": {
"terms": {
"field": "domain",
"size": 2000
},
"aggs": {
"groupby_page": {
"terms": {
"field": "page",
"size": 2000,
"min_doc_count": 2
}
}
}
}
}
}
}
}