Hi,
Is there a way with faceting or field collapsing to do the SQL equivalent of
SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND
other_criteria
i.e. I'm only interested in the total count not the individual records
and counts.
Cheers,
Dan
equiv of : SELECT count(distinct(field)) FROM index WHERE
length(field) 0 AND other_criteria
Hi,
Is there a way with faceting or field collapsing to do the SQL equivalent of
SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND
other_criteria
i.e. I'm only interested in the total
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