13. 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 search query from a user; obtaining a plurality of search results that satisfy the search query, wherein each search result identifies a 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.
16. The system of claim 13 , wherein each training instance includes data representing a position of the selected first document in an order of the search results provided to the particular user in response to the particular query.