Right now, each style/size is a separate document.
I agree, it makes far more sense to have each size be associates with
only one style. I think I'll pursue that route at first here, and
then for grouping similar items I may have to do some facet magic
(facets to show links for product_category/brand/color while at the
same time presenting only one thumbnail with a list of the sizes
available.. etc etc).
+--------------------------------------------------------+
| Matthew Runo
| Zappos Development
| [EMAIL PROTECTED]
| 702-943-7833
+--------------------------------------------------------+
On May 2, 2007, at 4:15 PM, Tom Hill wrote:
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
+--------------------------------------------------------+