Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 75287 invoked from network); 30 Mar 2011 03:24:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Mar 2011 03:24:15 -0000 Received: (qmail 76844 invoked by uid 500); 30 Mar 2011 03:24:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 76717 invoked by uid 500); 30 Mar 2011 03:24:13 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 76709 invoked by uid 99); 30 Mar 2011 03:24:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2011 03:24:12 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andrew.stuart@supercoders.com.au designates 50.23.246.234 as permitted sender) Received: from [50.23.246.234] (HELO osmium.mailguard.com.au) (50.23.246.234) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2011 03:24:05 +0000 Received: from osmium.mailguard.com.au (centos54base [127.0.0.1]) by osmium.mailguard.com.au (Postfix) with ESMTP id 5784F4CD77A for ; Wed, 30 Mar 2011 14:23:44 +1100 (EST) Received: from public001.crowdwave.com (ec2-174-129-235-19.compute-1.amazonaws.com [174.129.235.19]) by osmium.mailguard.com.au (Postfix) with ESMTPA id 4F1164CD7CA for ; Wed, 30 Mar 2011 14:23:40 +1100 (EST) Received: from public001.crowdwave.com (public001.crowdwave.com [127.0.0.1]) by public001.crowdwave.com (Postfix) with ESMTP id 512127A2FA for ; Wed, 30 Mar 2011 14:23:39 +1100 (EST) Received: from public001.crowdwave.com (public001.crowdwave.com [127.0.0.1]) by mx-int.flatraterecruitment.com.au (Postfix) with ESMTP id E3E887A4B6 for ; Wed, 30 Mar 2011 14:23:38 +1100 (EST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on public001.crowdwave.com X-Spam-Level: Received: from [192.168.1.104] (dsl-202-45-109-118-static.VIC.netspace.net.au [202.45.109.118]) by public001.crowdwave.com (Postfix) with ESMTPSA id 51B9B7A2FA for ; Wed, 30 Mar 2011 14:23:38 +1100 (EST) Message-Id: <6F4EB410-E2A4-4228-8F3D-718A5497C7EE@supercoders.com.au> From: "Andrew Stuart (SuperCoders)" To: user@couchdb.apache.org In-Reply-To: <4D929FDC.6040805@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Recommendations for how to do faceted search in CouchDB Date: Wed, 30 Mar 2011 14:23:35 +1100 References: <4EA8CEDD-16B5-42D5-ABF3-846164CFC4D4@supercoders.com.au> <4D929FDC.6040805@gmail.com> X-Mailer: Apple Mail (2.936) X-Virus-Scanned: ClamAV using ClamSMTP X-MailGuard-UID: 4d92a23c3fa01a6c X-MailGuard-ID: 4d92a23d69104b X-Filtered: by MailGuard - visit http://www.mailguard.com.au X-Old-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,AWL autolearn=ham version=3.2.5 thanks Patrick A question - does this technique also work if for example a job appears in multiple locations (melbourne & sydney), or it appears in multiple categories i.e. developers/software engineers/web programmers thanks andrew On 30/03/2011, at 2:13 PM, Patrick Barnes wrote: 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 > -- Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.http://www.mailguard.com.au/mg Click here to report this message as spam: https://login.mailguard.com.au/report/1C0dI02ork/6l9Om021I5Tc7F2B3vVGlU/0