How to index my documents to aggregate similar item listings together

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

You should be able to do this with a query using collapse on the Game field - Collapse search results | Elasticsearch Guide [8.7] | Elastic

Otherwise you end up with a bit of a complex document as you will need nesting to manage the differences with the numeric fields you have.

Hi Warkolm,
I can make the fields string. It doesn't have to be numeric. In that case, what changes could I make to my document? What type of nesting would work here?

I wouldn't use nesting as it can become complex, irrespective of if it's a string or a numeric. I would look to use collapse.

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