1. A method including: identifying, by a device, one or more candidate query refinements for a query based on one or more previous queries submitted by one or more users; generating, by the device and based on the one or more candidate query refinements, one or more term occurrence scores associated with one or more respective terms in the one or more candidate query refinements, the one or more term occurrence scores indicating a frequency of the one or more respective terms in the one or more candidate query refinements; calculating, by the device and based on the one or more term occurrence scores, a respective query refinement score for each of the one or more candidate query refinements; generating, by the device and for a particular candidate query refinement of the one or more candidate query refinements, a first refinement count, the first refinement count being based on a frequency of occurrence of the particular candidate query refinement in a log; generating, by the device and for the particular candidate query refinement, a second refinement count, the second refinement count being based on a frequency of occurrence of another candidate query refinement, of the one or more candidate query refinements, in the log; generating, by the device and based on the first refinement count and the second refinement count, a query refinement popularity score for the particular candidate query refinement; and storing, by the device, information associating the respective query refinement score with each of the one or more candidate query refinements and the query refinement popularity score with the particular candidate query refinement for use in selecting among the one or more candidate query refinements for the query.