Filter results by aggregation value

Is there a way to use a value provided by an aggregation to make another layer of filtering?

I'm making a standard query that search the incidence of terms in two fields, and wish to show only the docs whose _score is above or equal the average that I can get in the aggs.

Top hits aggregation might be of use

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.