Reputation: 2761
I just wanted to double check if I did not miss anything. In ElasticSearch 1.4 it is not possible to run any type of server side filtering on aggregation results, correct? I have for example an average percentage aggregation (0 .. ) and I want to remove everything that is above 0.9 in the results.
With ES 2.0 reducer this seems possible or right now at the client side, but that would both requiring a very high term count (in the end all of them) to figure this out.
Is there way I missed with ES 1.4 to achieve this?
Here an example:
{
"aggs": {
"group": {
"terms": {
"field": "contextRaw.site_city",
"order": {
"result": "desc"
}
},
"aggs": {
"result": {
"avg": {
"field": "somePercentage"
}
}
}
}
}
}
With the result that now also small buckets are on top with a percentage of 1.0, while I am not interested in those, but in the ones below 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
}
},
Upvotes: 2
Views: 2838
Reputation: 2761
I wasn't sure about the best place to ask, it got answered in the 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
.
Upvotes: 1