Post_filter for aggregation?


(David Martel) #1

Hi,

Is there a way to use a post filter in an aggregation?

The reason why I'm asking is that I use pipeline aggregation and need all result to do the processing but I don't need all of this data, simply the pipeline aggregation results.

At this moment, the response gives me 500 000 lines of JSON but I only need the pipeline aggregation results.

Is there a way to do that?

Thanks,

David


(Zachary Tong) #2

You can use filter_path Response Filtering to trim down the response to just the bare essentials that you need: https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#_response_filtering

I've found the double star particularly handy when doing pipeline work. E.g.

GET /test/_search?filter_path=aggs.**.my_pipeline_name

(system) #3