Hi @Mattanapol Konguthaikul (TH),
As of now, Azure AI Search does NOT support storing or querying an array of vectors (vector arrays) in a single document. Each document can only contain one vector field for each configured vector search field. This means you cannot natively store multiple vectors (i.e., one per chunk) inside a single document and run a vector similarity search across all of them.
To achieve your goal, follow this design pattern:
- Store each chunk as an individual document in the search index. Each chunk will have:
- Its own vector embedding
- A field like
documentId
to indicate the parent document it belongs to - Any other metadata (e.g., title, page number)
- At query time, run a vector similarity search across the chunk documents. This will return the most relevant chunks, each tied to their parent document via
documentId
. - Use code (either in your app backend or Azure Cognitive Search enrichment pipeline) to group results by
documentId
, ensuring:- You only return each document once.
- You can implement pagination over unique document-level results.
- Use scoring profiles or filters to prioritize certain metadata fields if needed.
Reference:
https://learn.microsoft.com/en-us/azure/search/vector-search-overview
https://learn.microsoft.com/en-us/azure/search/index-add-scoring-profiles
https://learn.microsoft.com/en-us/azure/search/vector-search-how-to-configure-vectorizer
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.
Let me know if you have any further Queries.