solr equiv of : SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND other_criteria

2010-12-22 Thread dan sutton
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

Re: solr equiv of : SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND other_criteria

2010-12-22 Thread Dennis Gearon
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

Re: solr equiv of : SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND other_criteria

2010-12-22 Thread Peter Karich
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

RE: solr equiv of : SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND other_criteria

2010-12-22 Thread Jonathan Rochkind
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

Re: solr equiv of : SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND other_criteria

2010-12-22 Thread Erik Hatcher
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

Re: solr equiv of : SELECT count(distinct(field)) FROM index WHERE length(field) 0 AND other_criteria

2010-12-22 Thread Jonathan Rochkind
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