I've a similar problem with a project I'm working on now. I am holding out for either SOLR-64 or SOLR-792 being a bit more mature before I need the functionality but if not I was thinking I could do multi-level faceting by indexing the data as a "String" like this:
id: 1 SHOE: Sneakers|Men|Size 7 id: 2 SHOE: Sneakers|Men|Size 8 id: 3 SHOE: Sneakers|Women|Size 6 etc and then in the UI, show just up to the first delimiter (you'll have to sum the counts in the UI too). Once the user clicks on "Sneakers", you would then add fq=SHOE:Sneakers|* to the query and then show the values up to the 2nd delimiter, etc. Alternatively, if you didn't want to use a wildcard query, you could index each level separately like this: id: 1 SHOE1: Sneakers SHOE2: Sneakers|Men SHOE3: Sneakers|Men|Size 7 Then after the user clicks on the 1st level, fq on SHOE1 and show SHOE2, etc. This wouldn't work so well if you had more than a few levels in your hierarchy. I haven't actually tried this and like I said I'm hoping I could just use a patch (really I hope 3.x gets released GA with the functionality but I won't hold my breath...) But I do think this would work in a pinch if need be. James Dyer E-Commerce Systems Ingram Content Group (615) 213-4311 -----Original Message----- From: Nguyen, Vincent (CDC/OD/OADS) (CTR) [mailto:v...@cdc.gov] Sent: Tuesday, October 05, 2010 8:22 AM To: solr-user@lucene.apache.org Subject: RE: multi level faceting Just to clarify, the effect I was look for was this. Sneakers Men (22) Women (43) AFTER a user filters by one of those, they would be presented with a NEW facet field such as Sneakers Men Size 7 (10) Size 8 (11) Size 9 (23) Vincent Vu Nguyen -----Original Message----- From: Otis Gospodnetic [mailto:otis_gospodne...@yahoo.com] Sent: Monday, October 04, 2010 11:44 PM To: solr-user@lucene.apache.org Subject: Re: multi level faceting Hi, I *think* this is not what Vincent was after. If I read the suggestions correctly, you are saying to use &fq=x&fq=y -- multiple fqs. But I think Vincent is wondering how to end up with something that will let him create a UI with multi-level facets (with a single request), e.g. Footwear (100) Sneakers (20) Men (1) Women (19) Dancing shoes (10) Men (0) Women (10) ... If this is what Vincent was after, I'd love to hear suggestions myself. :) Otis ---- Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch Lucene ecosystem search :: http://search-lucene.com/ ----- Original Message ---- > From: Jason Brown <jason.br...@sjp.co.uk> > To: solr-user@lucene.apache.org > Sent: Mon, October 4, 2010 11:34:56 AM > Subject: RE: multi level faceting > > Yes, by adding fq back into the main query you will get results increasingly >filtered each time. > > You may run into an issue if you are displaying facet counts, as the facet >part of the query will also obey the increasingly filtered fq, and so not >display counts for other categories anymore from the chosen facet (depends if >you need to display counts from a facet once the first value from the facet has >been chosen if you get my drift). Local params are a way to deal with this by >not subjecting the facet count to the same fq restriction (but allowing the >search results to obey it). > > > > -----Original Message----- > From: Nguyen, Vincent (CDC/OD/OADS) (CTR) [mailto:v...@cdc.gov] > Sent: Mon 04/10/2010 16:34 > To: solr-user@lucene.apache.org > Subject: RE: multi level faceting > > Ok. Thanks for the quick response. > > Vincent Vu Nguyen > Division of Science Quality and Translation > Office of the Associate Director for Science > Centers for Disease Control and Prevention (CDC) > 404-498-6154 > Century Bldg 2400 > Atlanta, GA 30329 > > > -----Original Message----- > From: Allistair Crossley [mailto:a...@roxxor.co.uk] > Sent: Monday, October 04, 2010 9:40 AM > To: solr-user@lucene.apache.org > Subject: Re: multi level faceting > > I think that is just sending 2 fq facet queries through. In Solr PHP I > would do that with, e.g. > > $params['facet'] = true; > $params['facet.fields'] = array('Size'); > $params['fq'] => array('sex' => array('Men', 'Women')); > > but yes i think you'd have to send through what the current facet query > is and add it to your next drill-down > > On Oct 4, 2010, at 9:36 AM, Nguyen, Vincent (CDC/OD/OADS) (CTR) wrote: > > > Hi, > > > > > > > > I was wondering if there's a way to display facet options based on > > previous facet values. For example, I've seen many shopping sites > where > > a user can facet by "Mens" or "Womens" apparel, then be shown "sizes" > to > > facet by (for Men or Women only - whichever they chose). > > > > > > > > Is this something that would have to be handled at the application > > level? > > > > > > > > Vincent Vu Nguyen > > > > > > > > > > > > > > > If you wish to view the St. James's Place email disclaimer, please use the >link below > > http://www.sjp.co.uk/portal/internet/SJPemaildisclaimer >