# Query expansion

Understand how expanding a query with related formulations can change retrieved candidates and can also introduce shifts in meaning.

Canonical URL: https://thecompanybrain.com.br/en/glossary/query-expansion
Authors: Luiz Gardelin
Updated: 2026-11-14T22:28:48.226Z

Query expansion broadens a search query with terms or formulations related to its initial expression. Its purpose is to reach candidates that the original wording might miss. Microsoft documents an example based on rewriting: generate semantically similar variants, run those queries, and evaluate their results. The cited capability is identified as a preview in that documentation. [Microsoft, query rewriting](https://learn.microsoft.com/en-us/azure/search/semantic-search-overview).

## Broaden without changing the need

A query is the way a person expresses a need, rather than the complete need itself. Expansion may help when vocabularies differ, but the transformation needs to retain important conditions. A name, period, or restriction should not disappear simply to make the wording broader.

In a hypothetical example, an employee searches for “accounting for business travel expenses.” Expansion could add wording about documenting expenditure during work-related journeys. If documents use that vocabulary, new candidates might appear. Expanding to any administrative expense, however, could also retrieve material that does not answer the question. Testing needs to examine preservation of meaning as well as the number of results.

Expansion differs from [result reranking](/en/glossary/result-reranking): it changes what is submitted to retrieval, whereas reranking changes the positions of available candidates. It is also separate from generating a final answer. A model may produce variants without the system composing any answer for the user. In Microsoft's documented implementation, rewriting and secondary ranking occupy different stages. [Microsoft, semantic ranking capabilities](https://learn.microsoft.com/en-us/azure/search/semantic-search-overview).

## Coverage and drift

In the hypothetical example, comparing the original question, proposed variants, and added documents would show whether expansion found useful guidance or abandoned the travel condition. The review can also distinguish what the employee wrote from what the system added, making the behavior easier to investigate. Without that distinction, a failed search may be attributed to the user's wording even though the system changed it.

An important limit is that related expressions are not necessarily equivalent. An internal abbreviation may have several meanings; broader wording may lose a decisive detail. Expansion should be assessed by its contribution to the task, with attention to [precision](/en/glossary/precision-in-information-retrieval) and [recall](/en/glossary/recall-in-information-retrieval). Finding more candidates does not establish that retrieval improved or that the additional documents are authorized for the person asking.

## Sources

- [Semantic ranking in Azure AI Search](https://learn.microsoft.com/en-us/azure/search/semantic-search-overview): Describes secondary ranking and query rewriting in a particular implementation; query rewriting is identified as a preview.

## Related reading

- [Result reranking](/en/glossary/result-reranking)
- [Recall in information retrieval](/en/glossary/recall-in-information-retrieval)
- [Precision in information retrieval](/en/glossary/precision-in-information-retrieval)
- [Access control](/en/glossary/access-control)
- [Access permission](/en/glossary/access-permission)
- [Chunk overlap](/en/glossary/chunk-overlap)
