# Many lookups, aggregated dump, collapse?

**URL:** <https://discuss.elastic.co/t/many-lookups-aggregated-dump-collapse/359663>\
**Category:** Elastic Search\
**Created:** [May 16, 2024, 7:28pm UTC](https://discuss.elastic.co/t/many-lookups-aggregated-dump-collapse/359663 "2024-05-16T19:28:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timothee\_Levilly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timothee_levilly/32/130106_2.png) [@Timothee\_Levilly](https://discuss.elastic.co/u/Timothee_Levilly)\
**Post date:** [May 16, 2024, 7:28pm UTC](https://discuss.elastic.co/t/many-lookups-aggregated-dump-collapse/359663/1 "2024-05-16T19:28:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [May 16, 2024, 7:44pm UTC](https://discuss.elastic.co/t/many-lookups-aggregated-dump-collapse/359663/2 "2024-05-16T19:44:02Z")

</div>

Have you thought about [nested](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) fields, where you could have a parent document for each individual model?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 13, 2024, 7:44pm UTC](https://discuss.elastic.co/t/many-lookups-aggregated-dump-collapse/359663/3 "2024-06-13T19:44:55Z")

</div>

Closed on June 13, 2024, 7:44pm UTC

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