Data and Knowledge SystemsIngestion and freshnessPrincipal
How would you detect and repair missing documents when an indexing run reports success?
By Amit Kumar3 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A policy-document indexer reports a successful run, but newly added refund exceptions cannot be retrieved. Some older versions remain searchable, and the source queue shows zero lag. Design an investigation that locates the missing source versions, define an honest completion signal, and choose a repair and serving policy for high-impact documents.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
A job-level success signal summarizes one execution. Coverage asks whether every intended source version reached a valid final state. Those are different measurements when a pipeline can skip individual failures, finish with partial results or acknowledge work before downstream processing is complete.
An indexer can finish its run while individual documents fail. If the allowed failure count is nonzero, “success” may mean the pipeline continued, not that every source object became searchable. Azure AI Search's indexer monitoring documentation explicitly distinguishes overall run success from per-document errors. The failure might be a parsing problem, a new field type the index cannot accept, an oversized document or a permission problem.
Start with one missing source ID. Follow it through discovery, extraction, transformation and index write. Did the source version enter the run? Was it rejected with an error tied to that document key? Is an older version still searchable? A stale old page is more dangerous than an obvious gap if the assistant confidently cites it as current policy.
I would define the success invariant at the document level. For each source version intended for publication, record a terminal outcome: indexed at version V, deliberately excluded with a reason, or failed and awaiting repair. Compare source inventory with indexed version inventory by tenant and document family. Alert on failure counts and age, not just job status or consumer lag. Keep rejected payload references and error classes in a repair queue, with access controls, so an operator can replay after fixing the parser or mapping. A retry must be idempotent and must not let an old failure overwrite a newer indexed version.
The failure policy depends on the use case. A public knowledge article may tolerate a small, visible delay. A new refund-policy exception that changes customer eligibility may require a publication barrier or temporarily suppressing answers in that scope until the index catches up. That is a product and source-authority decision, not a generic “always fail the entire batch” rule.
When the interviewer says the queue lag is zero, I would ask which acknowledgments that metric counts. A source event can be consumed and the indexing run can finish while one document is rejected. The useful evidence is end-to-end source-to-search coverage, including the exact versions users can retrieve.
For a hypothetical run with 10,000 intended source versions, 9,980 indexed versions and 20 parser failures, a permitted failure threshold may let the run finish. A 99.8-percent count does not say whether the missing 20 contain the only refund exceptions. Compare stable source identities and revisions, then classify each missing object. Equal source and index totals would still be inadequate if obsolete duplicates replace missing new documents.
Repair should retain failed objects’ identities, error categories and protected artifact references. After correcting the extraction or schema problem, replay the exact source revision if available or explicitly process the current one. Publish only when its complete chunk manifest is ready and still matches the desired source version. A delayed repair of revision 7 must not activate over revision 8. Test a parser failure followed by a newer successful update, then release the repair job and verify that the visible policy stays on the newer version.
Related questions
Keep practising data and knowledge systems
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux