# Search across multiple indices with diffrent fields

**URL:** <https://discuss.elastic.co/t/search-across-multiple-indices-with-diffrent-fields/209706>\
**Category:** Elasticsearch\
**Created:** [November 27, 2019, 2:46pm UTC](https://discuss.elastic.co/t/search-across-multiple-indices-with-diffrent-fields/209706 "2019-11-27T14:46:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![william\_ganrot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/william_ganrot/32/57878_2.png) [@william\_ganrot](https://discuss.elastic.co/u/william_ganrot)\
**Post date:** [November 27, 2019, 2:46pm UTC](https://discuss.elastic.co/t/search-across-multiple-indices-with-diffrent-fields/209706/1 "2019-11-27T14:46:12Z")

</div>

Hi!

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 27, 2019, 3:09pm UTC](https://discuss.elastic.co/t/search-across-multiple-indices-with-diffrent-fields/209706/2 "2019-11-27T15:09:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![william\_ganrot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/william_ganrot/32/57878_2.png) [@william\_ganrot](https://discuss.elastic.co/u/william_ganrot)\
**Post date:** [November 27, 2019, 4:06pm UTC](https://discuss.elastic.co/t/search-across-multiple-indices-with-diffrent-fields/209706/3 "2019-11-27T16:06:37Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 27, 2019, 4:44pm UTC](https://discuss.elastic.co/t/search-across-multiple-indices-with-diffrent-fields/209706/4 "2019-11-27T16:44:22Z")

</div>

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](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). 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.

---

<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:** [December 25, 2019, 4:44pm UTC](https://discuss.elastic.co/t/search-across-multiple-indices-with-diffrent-fields/209706/5 "2019-12-25T16:44:23Z")

</div>

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