: > I would like get the total count of the facet.field response values : : I'm pretty sure there's no way to get Solr to do that -- other than not : setting a facet.limit, getting every value back in the response, and : counting them yourself (not feasible for very large counts). I've : looked at trying to patch Solr to do it, because I could really use it : too; it's definitely possible, but made trickier because there are now : several different methods that Solr can use to do facetting, with : separate code paths. It seems like an odd omission to me too.
beyond just having multiple facet algorithms for perforamance making it difficult to add this feature, the other issue is hte perforamce of computing the number: in some algorithms it's relatively cheap (on a single server) but in others it's more expensive then computing the facet counts being returned (consider the case where we are sorting in term order - once we have collected counts for ${facet.limit} constraints, we can stop iterating over terms -- but to compute the total umber of constraints (ie: terms) we would have to keep going and test every one of them against ${facet.mincount}) With distributed searching it becomes even more prohibitive -- your description of using an infinite facet.limit and asking for every value back to count them is exactly what would have to be done internally in a distributed faceting situation -- except they couldn't just be counted, they'd have to be deduped and then counted) To do this efficiently, other data structures (denormalized beyond just the inverted index level) would need to be built. -Hoss