我想计算 Elasticsearch 中的术语聚合器计数之间的 pourcentile。
我的查询:
{
"query" : {
"match_all" : {}
},
"size" : 0,
"aggs": {
"eventName" : {
"terms" : { "field" : "json.eventName" }
}
}
}
结果聚合器:
"aggregations": {
"eventName": {
"doc_count_error_upper_bound": 0,
"buckets": [
{
"key": "term1",
"doc_count": 30235
},
{
"key": "term2",
"doc_count": 30216
},
{
"key": "term3",
"doc_count": 22177
},
{
"key": "term4",
"doc_count": 17173
}
]
}
}
我想要“term1”和“term4”之间的这个指标示例:56%