Post_filter for aggregation?


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?



You can use filter_path Response Filtering to trim down the response to just the bare essentials that you need:

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

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