8. A system comprising: one or more computers and one or more storage devices storing instructions that are configured, when executed by the one or more computers, to 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.
8. A system comprising: one or more computers and one or more storage devices storing instructions that are configured, when executed by the one or more computers, to 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. 10. The system of claim 8 , wherein the pruned set of terms contains terms whose weight is greater than zero.