: Is there a way to group and sort by facet count? I have a large set of : images, each of which is part of a different "collection." I am performing : a faceted search: : : /solr/select/?q=my+term&max=30&version=2.2&rows=30&start=0&facet=true&facet.field=collection&facet.sort=true : : I would like to group the results by collection count. : : So all of the images in the collection with the most image "hits" comes : first. : : Not sure how to do that....
there isn't really any way to do that. you could make two requests: in the first get the facet counts, and then in the second augment the query to boost documents that match the various facet field values (where the boost is determined by the count) bear in mind: this probably isn't going to be as useful of a user experience as it sounds. This will cause the results that have a lot in common with the other results to appear near the top -- but users rarely need UI assistance for finding the "common" stuff, the fact that it's common means it's lready pretty prevelant. There's also no reason to think that docs matching the facet value with the highest count are more relevant to the original query. If i'm searching products for "apple ipod" the category with the highest facet count is probably going to be something like "accessories" or "cases" and not "mp3 players" because there are a lot more chargers, cases, and headphones in the world that show up when you search for ipod then there are mp3 players -- that doesn't mean those accessory products should appear first in the list of matches. -Hoss