查找非直方图存储桶的累积和

1u4esq0p  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(0)|浏览(180)

有什么方法可以计算一个不是直方图的桶的累积和吗。根据文档,我们只能在直方图中使用累积总和管道聚合。
例如,我有两个术语聚合公司,我的\u secret\u key和字段“我的\u secret\u key”的metric valuecount。我想找到值count字段的累计和。
ElasticSearch有可能吗?

{
"aggregations": {
        "company": {
          "terms": {
            "field": "company.keyword"

          },
          "aggregations": {

            "my_secrey_key": {
              "terms": {
                "field": "my_secrey_key"
              },
              "aggregations": {

                "count": {
                  "value_count": {
                    "field": "my_secrey_key"
                  }
                },
                "cumulativeReviewCount" :{
                  "cumulative_sum" :{
                    "buckets_path": "count"
                  }
                }
              }
            }
          }
        }
      }
}

另外,这是我尝试过的,但失败了,因为累积总和只适用于直方图。我的密钥是一个字符串值。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题