An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
Hi Noushida,
Thank you for your question!
Currently, when using Azure OpenAI's "on your data" feature (which connects Azure Cognitive Search as a data source for Retrieval-Augmented Generation or RAG), only one Azure Cognitive Search index can be referenced per data source configuration. This is a platform limitation and is documented in the official Microsoft Azure documentation.
Limitation__:__
Azure OpenAI’s integration expects a single data source index to perform semantic or keyword-based searches. There’s currently no native support to query multiple search indexes in the same request through this built-in mechanism.
Recommended Workarounds:
Although querying multiple indexes directly in one request is not supported, here are three recommended approaches you can explore depending on your architecture and needs:
Option1: Consolidate Multiple Indexes into a Single Index
If the data in your different indexes has similar structure, you can merge them into a single Cognitive Search index and add a field like sourceType to distinguish content origins.
· Supported natively by Azure OpenAI’s data source config
· Azure Cognitive Search - Create and manage indexes
Option2: Use a Custom RAG Orchestration (Bring Your Own Data)
For more flexibility, you can build a custom RAG pipeline using tools like Azure Functions, LangChain, or Semantic Kernel. This allows you to:
1. Query multiple indexes programmatically using the Cognitive Search REST API.
2. Aggregate and rerank search results.
3. Pass the top-ranked documents into a Chat Completion request as part of the prompt.
· LangChain + Azure OpenAI Tutorial: Build a RAG App with LangChain and Azure OpenAI
· Cognitive Search REST API Reference: Search Documents - REST API
Option3: Multiple Search Queries in the App Layer
You can also perform separate search queries for each index from your application backend, then merge the results manually and feed them into a single Chat Completion call.
· This approach is simple and works well for quick POCs or demos, although it requires you to handle the logic externally.
Hope this helps, do let me know if you have any further queries.
Thank you!