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

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

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

I would recommend using the multi search API 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.

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