You're using three separate nested queries, but you should really use one nested query that wraps all three range queries together. That way all these range queries would apply to a single nested object (price).
Also to correctly count top-level objects (products) instead of just nested ones (prices), you should add "reverse_nested" aggregation at the end.
Hey Daniel,
I believe your query is incorrect.
You're using three separate nested queries, but you should really use one nested query that wraps all three range queries together. That way all these range queries would apply to a single nested object (price).
Also to correctly count top-level objects (products) instead of just nested ones (prices), you should add "reverse_nested" aggregation at the end.
Duh, you are right! Thanks for the feedback, I'll correct it later. And sorry for the very late reply. Somehow missed that.