# How to index my documents to aggregate similar item listings together

**URL:** <https://forum.opensearch.org/t/how-to-index-my-documents-to-aggregate-similar-item-listings-together/14173>\
**Category:** OpenSearch\
**Created:** [May 3, 2023, 9:54am UTC](https://forum.opensearch.org/t/how-to-index-my-documents-to-aggregate-similar-item-listings-together/14173 "2023-05-03T09:54:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![searchwithme](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@searchwithme](https://forum.opensearch.org/u/searchwithme)\
**Post date:** [May 3, 2023, 9:54am UTC](https://forum.opensearch.org/t/how-to-index-my-documents-to-aggregate-similar-item-listings-together/14173/1 "2023-05-03T09:54:53Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):

2.3

**Describe the issue** :

Say I have a gaming website and there are panels that look like this:

## Panel A:

Game: Super Mario  
Language : English  
Number of Players: Two  
Theme: Nature

## Panel B:

Game:Super Mario  
Language : French  
Number of Players: Two  
Theme: Nature

Now, in my website instead of having two different panels like above, I want it as one with a dropdown that allows a user to browse between the different languages, instead of 2 panels.

Could you please let me know how I could restructure the indices so I can aggregate similar item listings together

Elasticsearch has collapse feature - [Collapse search results | Elasticsearch Guide [8.7] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/collapse-search-results.html)

This is not supported in OpenSearch

How can I accomplish this? If it has to be nested, could you please let me know how the nesting should like?

**Configuration** :

**Relevant Logs or Screenshots** :

---

<div class="post-metadata">

**Author:** ![radu.gheorghe](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/radu.gheorghe/32/3516_2.png) [@radu.gheorghe](https://forum.opensearch.org/u/radu.gheorghe)\
**Post date:** [May 3, 2023, 3:03pm UTC](https://forum.opensearch.org/t/how-to-index-my-documents-to-aggregate-similar-item-listings-together/14173/2 "2023-05-03T15:03:47Z")

</div>

I’m pretty sure collapse works in OpenSearch in the same way. It may not be documented yet.

If not, the “top hits” aggregation might be a decent alternative.
