lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Can solr do the equivalent of "select distinct(field)"?
Date Tue, 01 Sep 2009 23:57:05 GMT

: lets say you filter your query on something and want to know how many
: distinct "categories" that your results comprise.
: then you can facet on the category field and count the number of facet
: values that are returned, right?

if you count the number of facet values returned you are getting a "count 
of disctinct values"

if you just want the list of distinct values in a field (for your whole 
index) there TermsComponent is the fastest way.

if you want the list of distinct values across a set of documents, then 
facet on that field when doing your query.

"select distinct category from books where bookInStock='true'" is analgous 
to looking at the facet section of...

   rows=0&q=bookInStock:true&facet=true&facet.field=category


-Hoss


Mime
View raw message