I posted same question on stackoverflow, but would like posting here as well.
By dynamic aggregation I means, the aggregation buckets are different per search query. Take ebay as example, if search for "iphone" https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313.TR12.TRC2.A0.H0.Xiphone.TRS0&_nkw=iphone&_sacat=0
The aggregations in left panel are:
- etc ...
The aggregations are:
- Guaranteed Delivery
- Buying Format
One possible approach is to define same aggregation fields for all documents, and when querying, pass all aggregation fields to query DSL.
But it is so heavy and not flexible.
Is there any simple solutions?