1. A method comprising: receiving, by one or more computers, a first query; determining query refinements based on the first query; generating, from the query refinements, refinement clusters, each refinement cluster corresponding to a particular topic and each refinement cluster including query refinements that are determined to belong to the particular topic to which the refinement cluster corresponds; ranking the refinement clusters; selecting the refinement cluster that is highest in the ranking relative to other refinement clusters in the ranking as a first search refinement cluster for the first query; and generating first topic prompt data based on the topic associated with the first search refinement cluster, the first topic prompt data describing a request for a first user input of an n-gram that belongs to the topic associated with the first search refinement cluster.