I began a similar thread under the subject "Distinct terms in facet field".
One thing I noticed though is that your fields seem to have a lot of controlled values, or lack free text. Are you sure SOLR is what you should be using? Perhaps a traditional RDB would be better and then you would have "GROUP BY" and aggregate functions at your disposal... HTH, Tim -----Original Message----- From: Qingdi [mailto:liuqin...@yahoo.com] Sent: Tuesday, April 28, 2009 1:07 PM To: solr-user@lucene.apache.org Subject: facet with group by (or field collapsing) Hi, Is it possible to group the search result on certain field and then do facet counting? For example, the index is defined with the following fields: Kid_Id, Family_Id, Age, School, Favorite_Sports (MultiValue Field) We want to query with Age between 10 yrs to 12 yrs and School in (School_A, School_B), and do faceting on Favorite_Sports. But instead of showing the count of kids for each sport, we want to show the count of Families. Each family can have multiple kids. How to group the search result on Family_Id, and then do faceting on Favorite_Sports? Appreciate your help. Qingdi -- View this message in context: http://www.nabble.com/facet-with-group-by-%28or-field-collapsing%29-tp23285038p23285038.html Sent from the Solr - User mailing list archive at Nabble.com.