Hi Matthew, You might be able to just get away with just using facets, depending on whether your goal is to provide a clickable list of styles_ids to the user, or if you want to only return one search result for each style_id.
For a list of clickable styles, it's basic faceting, and works really well. http://wiki.apache.org/solr/SimpleFacetParameters Facet on style_id, present the list of facets to the user, and if the user selects style_id =37, then reissue the query with one more clause (+style_id:37) If you want the ability to only show one search result from each group, then you might consider the structure of your data. Is each style/size a separate record? Or is each style a record with multi-valued sizes? The latter might give you what you really want. Or, if you really want to remove dups from search results, you could do what I've done.I ended up modifying SolrIndexSearcher, and replacing FieldSortedHitQueue, and ScorePriorityQueue with versions that remove dups based in a particular field. Tom On 5/2/07, Matthew Runo <[EMAIL PROTECTED]> wrote:
Hello! I was wondering - is it possible to search and group the results by a given field? For example, I have an index with several million records. Most of them are different sizes of the same style_id. I'd love to be able to do.. group.by=style_id or something like that in the results, and provide the style_id as a clickable link to see all the sizes of that style. Any ideas? +--------------------------------------------------------+ | Matthew Runo | Zappos Development | [EMAIL PROTECTED] | 702-943-7833 +--------------------------------------------------------+