1. A method implemented by a data processing apparatus, the method comprising: generating a document object model that represents a common format of documents in a collection of documents, where the document object model defines a structure of document parts corresponding to the format, wherein the document object model includes a plurality of nodes; obtaining data associated with queries for which one or more of the documents were identified as being responsive, wherein each query includes one or more search terms; selecting document parts of the identified documents containing one or more of the search terms; associating a respective weight with one or more nodes of the document object model based on a count of search terms contained in the parts of the identified documents that correspond to the nodes of the document object model; determining a first weights for each part of one or more parts of a first document, each first weight being derived from a weight associated with a node of the document object model corresponding to the part; and providing the determined first weights corresponding to parts of the first document to a ranking process for ranking the first document in a plurality of documents.