1. A method, performed by one or more server devices, comprising: identifying, using a processor of the one or more server devices, an implicitly defined semantic structure in a document, where a plurality of rules are associated with the implicitly defined semantic structure, and where the semantic structure includes a list having a header and a plurality of items associated with the header; determining, using a processor of the one or more server devices, a location of a first term and a location of a second term within the list; selecting, using a processor of the one or more server devices, one of the plurality of rules, as a selected rule, based on a relationship of the locations of the first and second terms within the implicitly defined semantic structure, where a first rule of the plurality of rules is selected when the first term is located in one of the plurality of items and the second term is located in a different one of the plurality of items, where a second rule of the plurality of rules, different than the first rule, is selected when the first term is located in one of the plurality of items and the second term is located in the same one of the plurality of items, and where a third rule of the plurality of rules, different than the first rule and the second rule, is selected when the first term is located in the header and the second term is located in one of the plurality of items; determining, using a processor of the one or more server devices, a distance value, reflecting a distance between the first and second terms, using a function based on the selected rule, where the function differs based on whether the selected rule corresponds to the first rule, the second rule, or the third rule; and outputting, using a processor of the one or more server devices, the distance value to rank the document for relevancy to a search query that includes the first term and the second term.
2. The method of claim 1 , where the document is an HTML (Hyper-Text Markup Language) document.