Query rewriting
Query rewriting transforms a user’s question into wording that a search system may retrieve more effectively. A rewrite may add corpus terminology, correct spelling, resolve conversation references, or create several focused queries.
Tiny example
Section titled “Tiny example”User: Can I send it back after two weeks?Rewrite: return policy after 14 daysThe rewrite matches likely policy language. It might also lose an exact order ID or misunderstand what “it” means.
Safe pattern
Section titled “Safe pattern”Search with the original query and one or more rewrites, record each version, and compare retrieval quality with and without rewriting. Microsoft’s query-rewrite documentation follows this original-plus-rewrites pattern and warns about losing exact terms such as product codes.1
FDE note
Section titled “FDE note”Rewriting adds another fallible model operation, latency, and cost. Use it for a measured query-understanding problem, not as a mandatory RAG stage.
Footnotes
Section titled “Footnotes”-
Microsoft, query rewriting in Azure AI Search. The documented API is vendor-specific and currently preview. ↩