Azure Cognitive Search query multiple indexes

Alex Gagnon 87 Reputation points
2022-11-25T17:19:11.087+00:00

In Elasticsearch, we are able to query multiple indexes in a single request but comma separating their names in the path, for example /index-1, index2/_search. Does Cognitive Search offer a comparable solution?

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
660 questions
0 comments No comments
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 17,761 Reputation points
    2022-11-30T12:31:07.383+00:00

    Thanks for reaching here! This is in our backlog and product team is working on this but right now would not be able to share timeline for this.

    Work around suggestion: You may try combining search results from different indexes so that the combined scores reflects the relevance of each doc in the combined results.

    The key is around the distribution of terms in each index. As long as the indexes are fairly similar, you should be able to merge the results and sort them by the search score. If different indexes are going to have very different sets of terms, then just merging them might not work as well.

    Here is a sample app that shows doing this across multiple search services, but could easily be modified to do it across multiple indexes instead: https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/main/multiple-search-services

    Let us know if further query.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sreeju Nair 11,601 Reputation points
    2022-11-25T18:39:29.57+00:00

    No. You can not search multiple indexes. Refer the following FAQ.

    https://learn.microsoft.com/en-us/azure/search/search-faq-frequently-asked-questions#can-i-search-across-multiple-indexes-

    Hope this helps.