So bottom line you're trying to get the count on distinct values on the 
loginName field? At least based on your query "*:*", if this is what you're 
after checkout the Stats component, specially the calcDistinct parameter, 
although if you expect a really high cardinality in the field this could be 
slow because it retrieves all the distinct values from all your shards 
(SolrCloud) and then loops to find overlapping field values, which is time 
consuming. A JIRA exists to improve this functionality using the HyperLogLog 
approximation https://issues.apache.org/jira/browse/SOLR-6968.

----- Original Message -----
From: "harish singh" <harish.sing...@gmail.com>
To: solr-user@lucene.apache.org
Sent: Monday, February 9, 2015 5:34:32 PM
Subject: [MASSMAIL]Total number of Facets

While doing a facet query:

example:

   - params:
   {
      - facet: "true",
      - indent: "true",
      - q: "*:*",
      - facet.field: "loginName",
      - wt: "json"
      }


By defualt, Solr return 100 Facets.
This is fine. If I do "facet.limit=-1", I can get all the facets.

Now suppose, there are 100,0000 distinct "loginName"s.
How to I get this count directly?


Basically, What I am trying to do is to do a query (search query or facet
query) and get the total distinct "loginName" in my data.
I don't want to do a "facet.limit=-1" and iterate over all the facets.  So
I am trying to find an alternative.
Having a difficult time finding some way to do this.  Has anyone tried to
do this before?



Thanks,
Harish

Reply via email to