1. A computer-implemented method comprising: receiving, by a search system, a search query; generating, by the search system, a potential substitute term that is related to a query term of the search query; identifying, by the search system, an original set of documents that are responsive to the search query; weighting each potential substitute term that appears in a document in the original set based on a prevalence of the potential substitute term in the original set of documents; producing a pruned set of terms whose weight satisfies a condition; determining that the potential substitute term is a member of the pruned set of terms; and in response to determining that the potential substitute term is a member of the pruned set of terms, modifying, by the search system, the search query to include the potential substitute term.