I want to control how elasticsearch generate aggregations. Like to control the order in which elasticsearch sort buckets. To customize count, calculating count based on score.
How can I do that. I am thinking about to write a plugin to achieve the same. Please guide.