I have an issues managing aggregations in a products based search engine and was hoping someone could give me some pointers about a specific issue.
My product have different categories of tags (brand, packaging, size...) and can be filtered checking one or multiple filters in each category. Filtering the products is easy enough but my problem is to update the tag choices that are still relevant to the current search.
I hope it will be clear enough with an example:
If i select a specific brand, i need to remove the packaging tags that don't match any product with the selected brand. Again, simple enough here. The tricky part is that when i have selected a brand, i want to still be able to show the other brands so that the user check more of them and see more products.
To be clear, lets say i have Brand A, B, C and packaging D, E and F. If i select brand A and packaging D and E don't have any product with brand A, i need to stop showing them. But i still want to be able to select brands B and C to widen the search.
Is this something i can handle in a single Elasticsearch API call or should this be handled in my client application by keeping these filters in memory somehow ?