Aggregation post processing

Hi all,

Are there any ways to perform post-processing on aggregation results with
elasticsearch version 1.4.4?

My scenario is as follows: for every document of type X, we want to find
out how many of its nested documents matches specific criteria, which are
divided into buckets with the filters aggregation.
For example: see

However we want to score/sort the documents based on how many nested
documents are matched in each bucket, with different weightings.

For example: score = buckets[0].doc_count * 0.2 + buckets[1].doc_count *
0.7 + buckets[2].doc_count * 0.1

I don't think this can be done inside a scripted field, as our filters
criteria may reference other documents per
We also have close to 13 million documents so we would like to avoid
bringing the post processing to client side.

Any help or advice would be appreciated.


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit