Sort on nested aggreagations

I have nested mapping and doing nested aggregations on it. I would like to sort by the most inner value - sum_num_transactions in this case. How can I achieve it? I have expected that on .nested(name, "breakdown") will be available something like:
.order(BucketOrder.aggregation("sum_num_transactions", true))
but it is not there for nested (only for terms) . How can I sort on sum_num_transactions?

  private NestedAggregationBuilder buildNestedAggregations(String name) {
            return AggregationBuilders.nested(name, "breakdown")

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