incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clement Hallet <clem...@challet.eu>
Subject Re: Recommendations for how to do faceted search in CouchDB
Date Thu, 31 Mar 2011 17:30:47 GMT
Hi,

I'm interested in that question too but a bit noob with CouchDB.

The goal of faceted search is to put conditions on several fields at a time, and get the union
of that set of conditions, right ?
then how would you do that in the query ?

-- 
Clément


Le 30 mars 2011 à 05:13, Patrick Barnes a écrit :

> You can do that with a single view:
> 
> In the map, emit for each field key [fieldname,fieldvalue] and value null.
> In the reduce, set it to '_count' (instead of a js function) to use the fast built-in
reduce.
> 
> Then you can query that view with startkey=[fieldname]&endkey=[fieldname,{}]&group=true
to see all the values in that field.
> 
> You don't really need _count, but that might be useful if you wanted to have some minimum
of how many times a term is used before you include it.
> 
> -Patrick
> 
> On 30/03/2011 1:50 PM, Andrew Stuart (SuperCoders) wrote:
>> hi folks
>> 
>> What's the best way to do facted search in CouchDB?
>> 
>> For example consider a jobs website where the user selects from dropdown
>> lists to narrow the search location/industry/job title i.e. melbourne/IT
>> industry/software engineer or sydney/accounting/bookkeeper
>> 
>> It doesn't seem practical to create a view for every combination of the
>> dropdown lists.
>> 
>> any suggestions as to the best way to do this?
>> 
>> thanks
>> 


Mime
View raw message