I have terms aggregation and I need sort result buckets by another field (date). Or I need to add 2 sub aggregations with max (and top hit) and min (and top hit).
I didn't find any API that allows me to do this.
I think I can add max subAggregation with top hit for the main terms aggregation, and create another terms aggregation with min with top hits sub aggregation, but it will be so heavy job.