How to implement dynamic aggregation?

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"

The aggregations in left panel are:

  • Features
  • Network
  • Model
  • Color
  • etc ...

But if search for Book,

The aggregations are:

  • Guaranteed Delivery
  • Condition
  • Price
  • Buying Format
  • etc...

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?


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.