Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 96144 invoked from network); 24 Aug 2009 06:40:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Aug 2009 06:40:28 -0000 Received: (qmail 38631 invoked by uid 500); 24 Aug 2009 06:40:46 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 38554 invoked by uid 500); 24 Aug 2009 06:40:46 -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 38544 invoked by uid 99); 24 Aug 2009 06:40:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2009 06:40:46 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.177] (HELO mail-vw0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2009 06:40:37 +0000 Received: by vws7 with SMTP id 7so1778579vws.29 for ; Sun, 23 Aug 2009 23:40:15 -0700 (PDT) MIME-Version: 1.0 Sender: adam@hjksolutions.com Received: by 10.220.12.12 with SMTP id v12mr5108228vcv.61.1251096015476; Sun, 23 Aug 2009 23:40:15 -0700 (PDT) In-Reply-To: References: Date: Sun, 23 Aug 2009 23:40:15 -0700 X-Google-Sender-Auth: deb840d91ce211a7 Message-ID: Subject: Re: How to code an advanced search From: Adam Jacob To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Sun, Aug 23, 2009 at 3:20 AM, Tom Sante wrote: > Like adam said, refactor each of those questions into a single view for each. > When you want to do a combined/advanced query send it to an external process: > http://wiki.apache.org/couchdb/ExternalProcesses > > The external process is a script (in a language of your choice) that > queries each view and handles the join logic and output json. > So you have the benefit that you don't have to tax the client with > heavy join calculations but still use couchdb as a proxy for handling > your query. > If you format the scripts json-output as a normal couchdb-return you > don't even need to modify your client code. Just out of curiosity, why would you want to have the CouchDB server handle the join like this? Unless you are doing some fancier magic to keep the combined view up-to-date (ie, kicking rows out of the M-Set only when a sub-view has changed, etc.) I'm not sure I see why you would want to centralize a heavy-weight operation rather than de-centralize it. What am I missing? :) Adam -- Opscode, Inc. Adam Jacob, CTO T: (206) 508-4759 E: adam@opscode.com