21. The non-transitory computer-readable storage device of claim 15 , wherein weighting each potential substitute term comprises using a number of times the potential substitute terms appears in the original set of documents to measure the prevalence of the substitute term.
15. A non-transitory computer-readable storage device storing software comprising instructions executable by one or more computers which, upon such execution, cause the one or more computers to perform operations comprising: receiving a search query; generating a potential substitute term that is related to a query term of the search query; identifying 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 the search query to include the potential substitute term.