How can I filter by count? / How can I apply a custom filter?


(Yeikel) #1

This question is a continuation of the following question : https://discuss.elastic.co/t/filter-based-on-the-doc-count-with-aggregations/62677

When building aggregations in Kibana , I get the following output :

My question is , how can I filter by count?

For example : Build a visualization where "doc_count": 4

Or , how can I run this specific query ?

GET /cars/transactions/_search
{

   "size": 0,
   "aggs": {
      "popular_colors": {
         "terms": {
            "field": "color"
         },
         "aggs": {
            "my_filter": {
               "bucket_selector": {
                  "buckets_path": {
                     "the_doc_count": "_count"
                  },
                  "script": "the_doc_count == 4"
               }
            }
         }
      }
   }
}

(Tim Sullivan) #2

That query at the end of your post uses a pipeline aggregation, which isn't yet supported in Kibana.


(Yeikel) #3

Can you filter the doc_count in Kibana with any other method?


(Tim Sullivan) #4

not at the moment


(Yeikel) #5

I understand , thank you


(system) #6