Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B47B942DD for ; Fri, 10 Jun 2011 15:27:44 +0000 (UTC) Received: (qmail 84502 invoked by uid 500); 10 Jun 2011 15:27:43 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 84340 invoked by uid 500); 10 Jun 2011 15:27:43 -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 84330 invoked by uid 99); 10 Jun 2011 15:27:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 15:27:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of peterwnolan@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 15:27:36 +0000 Received: by fxm6 with SMTP id 6so2574337fxm.11 for ; Fri, 10 Jun 2011 08:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=eHLEEmTE/HnT5whCpg649b0cRuwJKgv9Z6YmgsHfaKg=; b=etVhY56M7JjogZKMUHtUXlWNDtc9+PhGwT3Uy21w1Jse1zoNqLtXqYc7BV+PnTrIXq FQdTVVFFoofMD49hHWIm/WZ8ck3wapxMThYBTdcRMYnv+PxtofzQVnxJBSv7H/rljNUD HwheY13OxRUS0dFRz3qAJv6JnwqHbSUWHvmzk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gupMh6ExSrUFhTVT55haQQ/L1nKgElGtbXSd16WwthJogAqIkGr2iq5aQEYHv/jN1z HZxccmEAlgvTY9MZ+afnnoO0w8QHR45/Qsk1mKl8urtr8n0Wz4ctcG9S3WB4rK8+JslE hLAH2K5Ud3pqMAj73lafbZSdFiyZIx0CH9v4o= MIME-Version: 1.0 Received: by 10.223.155.140 with SMTP id s12mr2123036faw.148.1307719635293; Fri, 10 Jun 2011 08:27:15 -0700 (PDT) Received: by 10.223.2.130 with HTTP; Fri, 10 Jun 2011 08:27:15 -0700 (PDT) In-Reply-To: References: <64497E8E-7AEA-4E30-A44E-5AD285887150@challet.eu> <20110610100436.a3f9ab54.mk@cognitivedissonance.ca> Date: Fri, 10 Jun 2011 11:27:15 -0400 Message-ID: Subject: Re: One view per "query"? From: Peter Nolan To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=00235418701c53d88404a55d3486 --00235418701c53d88404a55d3486 Content-Type: text/plain; charset=ISO-8859-1 > > in regards to '10 million documents' > > not necessarily. Say you want to find a doc whose field of 'artist' is > 'dylan' > you can create a view called byArtist whose code looks like the following. function (doc) { if (doc.artist) { emit(doc.artist,otherStuffYouWantToKnow) } } then you can query this view with startKey='dylan' and endKey='dylan' and receive those docs that only have the field of artist set to 'dylan'. then you can do some kind of filtering on the client side. yes, you'll have to do a little copypasta for each field you're interested in querying on. Again, if you have more complicated search algorithms (like regexps and whatnot) check out the filter functions from the changes feed. out of curiosity, what kind of project are you working? Cause i did a little music app myself and would love to see code if you're willing to share. -good luck -Pete --00235418701c53d88404a55d3486--