ElasticSearch 按聚合结果过滤
ElasticSearch Filter by Aggregation Result
我只是想仔细检查一下我是否没有遗漏任何东西。在 ElasticSearch 1.4 中,不可能 运行 对聚合结果进行任何类型的服务器端过滤,对吗?例如,我有一个平均百分比聚合 (0 ..),我想删除结果中高于 0.9 的所有内容。
对于 ES 2.0 减速器,这似乎是可能的,或者现在在客户端,但这都需要非常高的术语计数(最终全部)才能解决这个问题。
有什么方法我错过了 ES 1.4 来实现这个目标吗?
举个例子:
{
"aggs": {
"group": {
"terms": {
"field": "contextRaw.site_city",
"order": {
"result": "desc"
}
},
"aggs": {
"result": {
"avg": {
"field": "somePercentage"
}
}
}
}
}
}
结果现在小桶也以 1.0 的百分比排在首位,虽然我对这些不感兴趣,但我对低于 0.9 的那些不感兴趣。
"aggregations": {
"group": {
"doc_count_error_upper_bound": -1,
"sum_other_doc_count": 5924518,
"buckets": [
{
"key": "value A",
"doc_count": 3921,
"result": {
"value": 1
}
},
{
"key": "value B",
"doc_count": 312,
"result": {
"value": 1
}
},
我不确定要问的最佳位置,official forums 中得到了回答。
in 1.4 there is nothing to filter the buckets returned by the
aggregations on the client side. Coming in 2.0 with the new pipeline
aggregations there is the bucket_selector aggregation which will allow
you to do this kind of filtering though
.
我只是想仔细检查一下我是否没有遗漏任何东西。在 ElasticSearch 1.4 中,不可能 运行 对聚合结果进行任何类型的服务器端过滤,对吗?例如,我有一个平均百分比聚合 (0 ..),我想删除结果中高于 0.9 的所有内容。
对于 ES 2.0 减速器,这似乎是可能的,或者现在在客户端,但这都需要非常高的术语计数(最终全部)才能解决这个问题。
有什么方法我错过了 ES 1.4 来实现这个目标吗?
举个例子:
{
"aggs": {
"group": {
"terms": {
"field": "contextRaw.site_city",
"order": {
"result": "desc"
}
},
"aggs": {
"result": {
"avg": {
"field": "somePercentage"
}
}
}
}
}
}
结果现在小桶也以 1.0 的百分比排在首位,虽然我对这些不感兴趣,但我对低于 0.9 的那些不感兴趣。
"aggregations": {
"group": {
"doc_count_error_upper_bound": -1,
"sum_other_doc_count": 5924518,
"buckets": [
{
"key": "value A",
"doc_count": 3921,
"result": {
"value": 1
}
},
{
"key": "value B",
"doc_count": 312,
"result": {
"value": 1
}
},
我不确定要问的最佳位置,official forums 中得到了回答。
in 1.4 there is nothing to filter the buckets returned by the aggregations on the client side. Coming in 2.0 with the new pipeline aggregations there is the bucket_selector aggregation which will allow you to do this kind of filtering though
.