# Need Help with Multi-Index Search and Boosting for Petstore Project

**URL:** <https://discuss.elastic.co/t/need-help-with-multi-index-search-and-boosting-for-petstore-project/353651>\
**Category:** Elasticsearch\
**Created:** [February 20, 2024, 7:37am UTC](https://discuss.elastic.co/t/need-help-with-multi-index-search-and-boosting-for-petstore-project/353651 "2024-02-20T07:37:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SwathiAngaluru](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SwathiAngaluru](https://discuss.elastic.co/u/SwathiAngaluru)\
**Post date:** [February 20, 2024, 7:37am UTC](https://discuss.elastic.co/t/need-help-with-multi-index-search-and-boosting-for-petstore-project/353651/1 "2024-02-20T07:37:12Z")

</div>

Hi Elastic community,

I'm currently working on a petstore project where we have three different pet providers (a, b, c), and their data is stored in three separate indices (provider-a, provider-b, provider-c). All three indices share the same data structure.

Each document in the indices contains a petBreedId, which may exist in other indices as well. I have a list of petBreedIds that I would like to search against the three indices, with a specific order of preference: provider-a, provider-b, and provider-c.

If a petBreedId is available in provider-a index, I want to ignore results from other two indices. If it's not available in provider-a but present in provider-b and provider-c, I want to have results from provider-b.

We have a similar implementation for a single petBreedId using indices boost with size 1. However, the indices boost with multiple petBreedIds is not yielding the expected results.

I'm seeking assistance in crafting a query that achieves the desired behavior for searching multiple petBreedIds across the three indices with the specified order of preference. Any insights or suggestions would be greatly appreciated.

Elastic search version : 7.16.3  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![gtube\_gtube](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gtube_gtube/32/132032_2.png) [@gtube\_gtube](https://discuss.elastic.co/u/gtube_gtube)\
**Post date:** [February 23, 2024, 9:30am UTC](https://discuss.elastic.co/t/need-help-with-multi-index-search-and-boosting-for-petstore-project/353651/2 "2024-02-23T09:30:30Z")

</div>

Looking for an answer on this one, i have a similar situation.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 23, 2024, 9:34am UTC](https://discuss.elastic.co/t/need-help-with-multi-index-search-and-boosting-for-petstore-project/353651/3 "2024-02-23T09:34:44Z")

</div>

I would recommend using the [multi search API](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-multi-search.html) to send 3 queries in one request, each targeting a single index. You can then select between the three result sets depending on whether they do contain results or not.

---

<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:** [March 22, 2024, 9:34am UTC](https://discuss.elastic.co/t/need-help-with-multi-index-search-and-boosting-for-petstore-project/353651/4 "2024-03-22T09:34:54Z")

</div>

Closed on March 22, 2024, 9:34am UTC

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