1. A method comprising: receiving a partial query entered into a search field on a computing device; receiving data indicating a document presented on the computing device during entry of the partial query; obtaining a set of candidate query completions for the partial query; identifying one or more search result documents for each of one or more respective candidate query completions in the set; calculating similarity scores for candidate query completions in the set, wherein calculating a similarity score for a given candidate query completion of the set of candidate query completions is based at least in part on a similarity between content in the presented document and content in the one or more search result documents identified for the given candidate query completion; selecting one or more of the candidate query completions in the set as refined query completions for the partial query based at least in part on the similarity scores; and providing the refined query completions for presentation by the computing device.
1. A method comprising: receiving a partial query entered into a search field on a computing device; receiving data indicating a document presented on the computing device during entry of the partial query; obtaining a set of candidate query completions for the partial query; identifying one or more search result documents for each of one or more respective candidate query completions in the set; calculating similarity scores for candidate query completions in the set, wherein calculating a similarity score for a given candidate query completion of the set of candidate query completions is based at least in part on a similarity between content in the presented document and content in the one or more search result documents identified for the given candidate query completion; selecting one or more of the candidate query completions in the set as refined query completions for the partial query based at least in part on the similarity scores; and providing the refined query completions for presentation by the computing device. 2. The method of claim 1 , wherein: identifying the search result documents includes obtaining search quality scores for the search result documents, and selecting the one or more of the candidate query completions is further based on the search quality scores for the search result documents.