Search across multiple indices with diffrent fields


I have a cluster with multiple indices which have different fields with the same content. For example one index has the field 'FullName' and another field might have 'FirstName' & 'LastName'. I want to search a full name across these two indices and prioritize them correctly, but I'm having a hard time, especially when it comes to prioritize the hits. I really need some help here and I appriciate any help i can get!

I'm using java spring for the project.

You can try to use a multimatch query or a bool query with multiple should clauses containing a match query on each field.

My solution right Bow is a bool query with multiple shoulds but i Still cant really get a result I'm happy with. Is there something special I need to think about? As you might figurer I'm pretty new to elasticsearch. Thank you!

Hard to say with no information about what you have and what you are doing.

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

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