From couchdb-user-return-663-apmail-incubator-couchdb-user-archive=incubator.apache.org@incubator.apache.org Thu Jul 03 18:52:12 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 6125 invoked from network); 3 Jul 2008 18:52:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2008 18:52:12 -0000 Received: (qmail 10146 invoked by uid 500); 3 Jul 2008 18:52:12 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 10119 invoked by uid 500); 3 Jul 2008 18:52:12 -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 10107 invoked by uid 99); 3 Jul 2008 18:52:12 -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:52:12 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of damienkatz@gmail.com designates 64.233.166.182 as permitted sender) Received: from [64.233.166.182] (HELO py-out-1112.google.com) (64.233.166.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 18:51:20 +0000 Received: by py-out-1112.google.com with SMTP id u52so690440pyb.13 for ; Thu, 03 Jul 2008 11:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=N9VtY21fgtzZoulEnNUeLIJ2kOL871qTjSBoRv8pLc8=; b=oXWtLg0UVawCTO6ZvLC8WWEWeGtFdpsil7L28FTIwEfNrAJ+nQjFS4D6WWNpLhDYZr GNUVuMJXgce08E6BwRkzebx5T7qnyRVyckReSaDLUx8g2FUj2pPYjBklAN2qeQf+jl06 +vt1ylZ16IMjx0NqB1mVGhZx71qUKV1s1vQoQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=a+tPhIkAhlcygkgmGbNsbHDTaZmba6J2UvpiDU688GFAwKHXFHFhNfdUshdaeQPui2 CJmlGOlxDQ7gpMaZb5nJegf6FzWko3zk/JK1kwuz195DtXjPot/S/DwxZT65hbFmWt/y vbFL4qtxtRUc5F2QopzAzftHGYYtNB+5gJa0g= Received: by 10.35.79.3 with SMTP id g3mr694475pyl.19.1215111100875; Thu, 03 Jul 2008 11:51:40 -0700 (PDT) Received: from ?192.168.1.109? ( [66.169.90.125]) by mx.google.com with ESMTPS id u2sm1596923pyb.16.2008.07.03.11.51.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 03 Jul 2008 11:51:40 -0700 (PDT) Message-Id: <648A5942-D222-4D62-B61E-F307706F0225@gmail.com> From: Damien Katz To: couchdb-user@incubator.apache.org In-Reply-To: <26E97585-7516-495D-8C2E-ED46903BB577@apache.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: Views using JSON Arrays Date: Thu, 3 Jul 2008 14:51:38 -0400 References: <377590.28814.qm@web57215.mail.re3.yahoo.com> <860DFB74-40BB-4423-A9E5-EA17837539C0@apache.org> <26E97585-7516-495D-8C2E-ED46903BB577@apache.org> X-Mailer: Apple Mail (2.926) X-Virus-Checked: Checked by ClamAV on apache.org On Jul 3, 2008, at 2:34 PM, Jan Lehnardt wrote: > > 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. :) The view indexes can indeed do multiple lookups at once. The only thing is I don't think a GET with all the keys are URL args is the way to go as it can get really long and cause problems with proxies and HTTP libs, a POST with the lookup keys as the body is probably better. > > > Cheers > Jan > --