← All questions
Retrieval & EmbeddingsHard· System Design· Latency· Indexing

How do you handle a requirement for near-real-time searchability when document expansion generation is too slow?

To satisfy both the need for immediate searchability and the requirement for full vocabulary coverage, decouple the indexing process. Index new documents with their literal text as soon as they are published to ensure they are searchable within the five-minute window. Subsequently, run the expansion generation as a background batch process and update the index entries in place once the expansion is complete.

Code playground (Python)