1. A computer-implemented method comprising: obtaining a pair of search queries including (i) a first search query and (ii) a second search query; obtaining (i) a first set of ranked images that are identified as responsive to the first search query, and (ii) a second set of ranked images that are identified as responsive to the second search query; for each of the images of the first set of images, determining a respective image distance between the image of the first set of images and each image of the second set of images; generating a score for each pair of images that includes an image from the first set of images and an image from the second set of images, wherein the score for each pair of images is based at least on (i) the rank of the image of the first set of images, (ii) the rank of the image of the second set of images, and (iii) the determined image distance between the image of the first set of images and the image of the second set of images; determining a measure of similarity between (i) the first set of images that are identified as responsive to the first search query, and (ii) the second set of images that are identified as responsive to the second search query based on the scores; and assigning the pair of search queries to a cluster of search queries based at least on the measure of similarity between (i) the first set of images that are identified as responsive to the first search query, and (ii) the second set of images that are identified as responsive to the second search query.