Implement information extraction solutions 5.1 Build retrieval and grounding pipelines
A RAG skillset uses Text Split and an index projection to write chunks into the same…
Study guide skill: Configure RAG ingestion flow, including documents and using optical character recognition (OCR)
Question B7-021
A RAG skillset uses Text Split and an index projection to write chunks into the same index as the indexer, and the projection doesn't set projectionMode. Searches return some documents whose chunk and vector fields are empty, and they crowd out real chunks. What should you change?
Select one answer.
Answer: B
With one index, omitting projectionMode uses includeIndexingParentDocuments, where parent documents coexist with chunks and have null chunk fields. Microsoft recommends skipIndexingParentDocuments, which indexes only the chunks, with parent fields repeated on each one. The parent field can't be the document key, and the key must be Edm.String with the keyword analyzer.
Deep dive
How it works
Index projections let a skillset that chunks documents (for example, with Text Split) write each chunk as its own search document, with the parent's fields copied onto every chunk. The docs describe three layouts:
- Single index, uniform document shape: Only chunk documents are indexed. Set both the indexer's and the projection's targetIndexName to the same index, and set projectionMode to skipIndexingParentDocuments.
- Single index, mixed shapes: Parent documents and chunk documents coexist, and the parent documents have null chunk fields. This is includeIndexingParentDocuments, and it's what you get if you omit projectionMode, because it's the default.
- Separate indexes: A parent index for metadata lookups and a child index for search.
The question describes the second layout by accident. projectionMode was left out, so parent documents were indexed too. Their chunk and vector fields are empty, and they compete with real chunks in results. For most RAG scenarios the docs recommend the first layout, so set projectionMode to skipIndexingParentDocuments.
Index schema rules for projections:
- The document key uniquely identifies each chunk and must be Edm.String with the keyword analyzer.
- A separate parent field (parent_id in the examples) links each chunk to its parent. It must be Edm.String and filterable, and it can't be the document key.
The other options, and when you'd use them
- Make parent_id the document key: The parent field can't be the key. Every chunk of a parent shares the same parent_id, so it can't identify chunks uniquely.
- Set includeIndexingParentDocuments explicitly: That's already the default and is causing the empty parent documents. Parent documents get null chunk fields, not chunk content.
- Remove the keyword analyzer from the key: The key field must use the keyword analyzer. Changing it would break the projection setup, not fix the extra documents.
Exam tip
Omitting projectionMode means includeIndexingParentDocuments, which leaves parent documents with empty chunk fields in the index. For RAG, set skipIndexingParentDocuments so only chunks are indexed.
References
Last reviewed: