Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 96685 invoked from network); 3 Jul 2008 18:35:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2008 18:35:09 -0000 Received: (qmail 87415 invoked by uid 500); 3 Jul 2008 18:35:01 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 87395 invoked by uid 500); 3 Jul 2008 18:35:01 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 87383 invoked by uid 99); 3 Jul 2008 18:35:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 11:35:00 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 18:34:09 +0000 Received: from [10.0.2.3] (e179134136.adsl.alicedsl.de [::ffff:85.179.134.136]) (AUTH: LOGIN jan, SSL: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Thu, 03 Jul 2008 18:34:27 +0000 Message-Id: <26E97585-7516-495D-8C2E-ED46903BB577@apache.org> From: Jan Lehnardt To: couchdb-user@incubator.apache.org In-Reply-To: <860DFB74-40BB-4423-A9E5-EA17837539C0@apache.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: Views using JSON Arrays Date: Thu, 3 Jul 2008 20:34:24 +0200 References: <377590.28814.qm@web57215.mail.re3.yahoo.com> <860DFB74-40BB-4423-A9E5-EA17837539C0@apache.org> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org On Jul 3, 2008, at 20:17, Jan Lehnardt wrote: > > On Jul 3, 2008, at 20:07, Paul Bonser wrote: > >> On Thu, Jul 3, 2008 at 8:01 AM, Bradford Winfrey > > wrote: >> >>> We would get back each one of our tags as a key, yea? Only if we >>> supplied one at a time. So how does one go about supplying a >>> range, array (not sure what we'd call it here) of keys to be >>> searched on? http://...?key=["octopus","hockey"] maybe? I'm >>> unsure of the plan of attack for such a thing. Maybe I'm just >>> going about it in the wrong direction. Any thoughts? >> >> Hey everyone. I've pretty much just been watching the mailing list >> here myself. >> >> This is the second time somebody has asked about this since I've >> started watching this mailing list. I could see it being a valuable >> feature. >> >> Would it be valuable to add the ability to query a view with multiple >> keys, getting the results for each of those keys back? Something like >> http://...?key_list=["octopus","hockey"] >> >> If I were interested in investigating how hard it would be to add >> that >> feature, where would I start looking in the code? > > This simply doesn't fit the way views work. They are single indexes > that you > can use for single-key or or key-range lookups. if you need random > access > you'd basically need to query the view as many times as you have keys > to search. No matter if you do that in front or behind the API. Hey you smart-ass, on the one hand you are trying to recruit new developers and on the other hand you discourage people from adding useful features. Make up your mind man! Paul, if you come up with a nice solution, we'd be happy to look at integrating it. Please give it a try. To investigate the code it is probably best to start at src/couchdb/couch_http.erl as it defines the HTTP API and handles the requests you already know and just drill down from there. Cheers Jan --