Have you investigated 'field collapsing'? I believe that it is a least the
'DISTINCT' part.
Dennis Gearon
Signature Warning
It is always a good idea to learn from your own mistakes. It is usually a
better
idea to learn from others’ mistakes, so you do not have to make them
facets=truefacet.field=field // SELECT count(distinct(field))
fq=field:[* TO *] // WHERE length(field) 0
q=other_criteriaAfq=other_criteriaB// AND other_criteria
advantage: you can look into several fields at one time when adding
another facet.field
disadvantage: you get the counts splitted by
in trunk.
From: Peter Karich [peat...@yahoo.de]
Sent: Wednesday, December 22, 2010 6:10 AM
To: solr-user@lucene.apache.org
Subject: Re: solr equiv of : SELECT count(distinct(field)) FROM index WHERE
length(field) 0 AND other_criteria
facets
On Dec 22, 2010, at 09:21 , Jonathan Rochkind wrote:
This won't actually give you the number of distinct facet values, but will
give you the number of documents matching your conditions. It's more
equivalent to SQL without the distinct.
There is no way in Solr 1.4 to get the number of
Well, that's true -- you can get the total number of facet values if you
ALSO are willing to get back every facet value in the response.
If you've got a hundred thousand or so unique facet values, and what you
really want is just the _count_ without ALSO getting back a very large
response