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.