7. A system comprising: one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising: receiving a query comprising a first term; identifying one or more synonyms for the first term, wherein identifying the one or more synonyms comprises: determining that the first term and a second term satisfy predetermined criteria associated with a particular class of related terms, in response to determining that the first term and the second term satisfy the predetermined criteria, selecting a threshold that is different from a default threshold, wherein the default threshold is a threshold that is used to evaluate terms that do not satisfy the predetermined criteria associated with the particular class of related terms, generating a score for the first term and the second term by evaluating a relationship between the first term and the second term, and determining that the second term is a synonym of the first term based on applying the generated score to the selected threshold; generating an altered query using the second term; and processing the altered query to produce search results.
12. The system of claim 7 , wherein the generated score is based on an extent to which users switched between the first and second terms when entering search queries.