Details
-
New Feature
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
4.0-ALPHA
-
None
Description
When returning facet.field=<name of field> you will get a list of matches for distinct values. This is normal behavior. This patch tells you how many distinct values you have (# of rows). Use with limit=-1 and mincount=1.
The feature is called "namedistinct". Here is an example:
Parameters:
facet.numTerms or f.<field>.facet.numTerms = true (default is false) - turn on distinct counting of terms
facet.field - the field to count the terms
It creates a new section in the facet section...
This currently only works on facet.field.
<lst name="facet_counts"> <lst name="facet_queries"/> <lst name="facet_fields">...</lst> <lst name="facet_numTerms"> <lst name="localhost:8983/solr/"> <int name="price">14</int> </lst> <lst name="localhost:8080/solr/"> <int name="price">14</int> </lst> </lst> <lst name="facet_dates"/> <lst name="facet_ranges"/> </lst> OR with no sharding- <lst name="facet_numTerms"> <int name="price">14</int> </lst>
Several people use this to get the group.field count (the # of groups).