Many lookups, aggregated dump, collapse?

Let's say I have an index where my documents are cars.

Each car some of the following attributes: make, model, color, production year, engine type, length, number of seats, etc.

I have a list of models for a given brand.
I want to retrieve the generic information about each model so I only need to pull one document for each model.

Example: the model is a Camry. I want to know it's a sedan, 5 seats, 15 feet long, etc. I don't care about each individual camry's color, year, etc.

Here is what I thought about doing:

  • Multisearch: To run many lookups but still, it is not scalable
  • Match all query with a filter on Make and collapse on Model: Not compatible with paginated search and my index is too large
  • Aggregate on Model, sub-aggregate on the fields I am looking for, filter by Make. Is that too computationally intensive?

Is there another option I didn't think of, or a workaround for the issues I am encountering?

Have you thought about nested fields, where you could have a parent document for each individual model?

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