title: ElasticSearch Java API sorting aggregation
body: <p>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). </p>
  
  <p>I didn't find any API that allows me to do this.</p>
  
  <p>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.</p>