How to add sorting to multi bucket aggregation?



I have some mapping with sample data, and also query aggregating that data, that works ALMOST like I want it - thanks to "size": 1 it gets me only one variant.. but I'd like it to get cheapest, so I'm missing sorting by price.
here's my query:

I tried in "sort" putting variant-sum>_count, variant-sum>sum-filter.. and many, really many other options. Is it even possible in this place to sort by summed price?

(system) closed #2

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