7. A computer program product, encoded on one or more non-transitory computer storage media, comprising instructions that when executed by one or more computers cause the one or more computers to perform operations comprising: receiving a search query from a user; obtaining a plurality of search results that satisfy the search query, wherein each search result identifies respective document of a plurality of documents; identifying a respective condition for each document of the plurality of documents, wherein each condition comprises one or more features of the user, the search query, and the document; obtaining a ranking model that produces a score for a particular document given a particular condition for the particular document, the score representing a likelihood that the user will select the particular document when identified by a search result provided in response to the search query, the ranking model being trained on training instances that each identify a first document selected by a particular user when the first document was identified in search results provided to the particular user in response to a particular search query; using the ranking model to compute a respective score for each document of the plurality of documents; and ranking the plurality of search results according to the respective computed score for each document of the plurality of documents.
8. The computer program product of claim 7 , wherein each training instance identifies a condition comprising one or more features of the particular user and one or more features of the particular search query.