August 2019
Intermediate to advanced
560 pages
13h 41m
English
The purpose of this is to perform sorting on the fields of the buckets from the aggregation in the previous stage:
"aggs": {"per_symbol":{"terms": {"field":"symbol"},"aggs":{"total_dividend": { "nested": {"path":"announcement"},"aggs": {"total_amount": {"sum": {"field": "announcement.amount"}}}},"sort": {"bucket_sort": {"sort": [{"total_dividend.total_amount":{"order":"desc"}}],"from":0,"size":3}}}}}
"per_symbol": {"doc_count_error_upper_bound": 0,"sum_other_doc_count": ...Read now
Unlock full access