I'm working into a new search for a ecommerce and need to do a better aggregation on the price field.
The current filter is just awful, we do a stats aggregation to know the lowest and bigger price, then we manually create 5 ranges of price and it's made another query with a range aggregation to finally get the count of products in the 5 ranges of price.
But this is very complex and slow, i know, there must be a way to do this simples and better.
Elasticsearch provide something to do this automatic?
And if yes, there is any way to do a better distribution? Today we just equally create the 5 slots, but most of times, the products stay into a same price range, so in this range is where most of the slots should stay.