From user-return-8853-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sat Feb 20 18:31:40 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 43549 invoked from network); 20 Feb 2010 18:31:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Feb 2010 18:31:40 -0000 Received: (qmail 38951 invoked by uid 500); 20 Feb 2010 18:31:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 38892 invoked by uid 500); 20 Feb 2010 18:31:38 -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 38882 invoked by uid 99); 20 Feb 2010 18:31:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Feb 2010 18:31:38 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of normanrosner@googlemail.com designates 72.14.220.156 as permitted sender) Received: from [72.14.220.156] (HELO fg-out-1718.google.com) (72.14.220.156) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Feb 2010 18:31:27 +0000 Received: by fg-out-1718.google.com with SMTP id e12so652274fga.5 for ; Sat, 20 Feb 2010 10:31:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:references; bh=PAJ2iV4KvUJrsaAQ8OBxiMaa1HU6QrihhLI3JbOCbu8=; b=ZEARgioudYcHt7XZfvwUlTXvw8Fi+5OF4/8IkRIeB3jI4Z+mw3kWGInCz1FmWxD/Tw 6mEBuliLw4bE09eA+rPPsk+dRT/oxVWSx036a56taJfQV3yAcpTjEOU2/hI8lul0EgzP Z+B54pnB/30rNat+DP5COAOrCP0ZTD8/d1Ie8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date :references; b=B4F4/Gccwl/c2lbVh/U3gC85NH2nvapLCf7wJPV+SMCErsO+uMw03BtaStlw0XGcYX lwpaCQhj45RRdyBuTJA7u5v1ou2va/VaNOMHpnNhA3Pr6cRVEoNfbCAd/75/OrRasvtm SCRSTZYnBHeWNewHC9Xn9zIMVj5Gyw6T5AnCI= Received: by 10.102.169.17 with SMTP id r17mr9184280mue.123.1266690666818; Sat, 20 Feb 2010 10:31:06 -0800 (PST) Received: from ?192.168.178.24? (p579FB632.dip.t-dialin.net [87.159.182.50]) by mx.google.com with ESMTPS id y37sm6836983mug.40.2010.02.20.10.31.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 20 Feb 2010 10:31:05 -0800 (PST) Message-Id: <943A713D-FBB0-48E6-8800-26A16250CAE9@googlemail.com> From: Norman Rosner To: "user@couchdb.apache.org" In-Reply-To: <695B0C96-A71C-40E2-88A0-6CFB38F7ED3D@couch.io> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: Chaining of views/MapReduce Date: Sat, 20 Feb 2010 19:30:23 +0100 References: <96B56DFD-CE21-4B69-9D43-C8CF3F841C9F@googlemail.com> <0A8494CB-1051-451F-AAE9-F27CD09BD885@sourcegarden.de> <6B5D22A9-F9E5-4EEC-91B8-536A2BB571EF@googlemail.com> <695B0C96-A71C-40E2-88A0-6CFB38F7ED3D@couch.io> X-Virus-Checked: Checked by ClamAV on apache.org Am 19.02.2010 um 16:10 schrieb J Chris Anderson : > > On Feb 17, 2010, at 5:29 PM, Norman Rosner wrote: > >> >> On 17.02.2010, at 23:15, Mario Scheliga wrote: >> >>> Hi Norman, >>> >>> updating a document from map-function its not possible and seems >>> to be the wrong way. >>> Thinking of map function processing docs seperatly (sandbox), so >>> you are able to >>> spread the execution over thousand of servers ;-) >> >> True that! But: suppose I'm just creating/updating one document per >> couchdb-instance, that should be ok, right? Because after that, I >> can easily get all the result documents and merge them together. I >> would do it in as similar way in Hadoop. And as far as I read in >> the loooong archives of this list, I'm not the only one who wants >> to do such things. > > > The "proper" way to do this is to have a simple CouchDB map reduce > view that is the 1st phase of your chain. > > Then query the view with group=true and store the output into an > empty db (one document per row). > > Now you can write another view on top of the derived db to do the > second phase (sort by value, etc). > > Chris > Hey Chris in the end I did in a similar way but I was wondering if I could do it in the map function. But I'm aware now that it is not possible. As I wrote in the beginning: Im just getting started with CouchDB. But thanks for the proper Way explanation. Cheers, norman >> >> cheers, >> norman >> >>> >>> greez >>> mario >>> >>> Am 17.02.2010 um 21:04 schrieb Norman Rosner: >>> >>>> Hi folks, >>>> >>>> first, I'll have to admit that I'm kinda new to JavaScript and of >>>> course to CouchDB. Second I just reuse the subject so I hope it >>>> also pops up if anybody searches for it. >>>> >>>> As I read chaining of views is not possible yet but it's >>>> mentioned couple of times on the mailing list. So here's what I >>>> want to do: >>>> >>>> 1. Create a list of unique labels/tags/whatever through all of >>>> the documents (e.g. all nouns that are in the documents) >>>> 2. Extract all labels/tags/nouns of each document and check them >>>> again the before calculated result in some kind of way >>>> >>>> For the second point I created a view which works except of the >>>> checking against the result from point 1. Now I'm trying to solve >>>> point 1. >>>> And here my questions begin: How can I create/update a document >>>> from inside of a map function? As I think of it, I'll have to >>>> make a HTTP GET to load the document in each iteration. I found >>>> some HTTP stuff in the test.js in the test folder, but I'm not >>>> quite sure how to use it and if it's the right way of thinking? >>>> Is there any way of using global variables throughout >>>> 'couchapps' (e.g. through the lib folder and thelike)? >>>> >>>> Any help of you CouchDB kings would be greatly appreciated! >>>> >>>> Cheers, >>>> >>>> norman >>> >>> >>> -- >>> Sourcegarden GmbH HR: B-104357 >>> Steuernummer: 37/167/21214 USt-ID: DE814784953 >>> Geschaeftsfuehrer: Mario Scheliga, Rene Otto >>> Bank: Deutsche Bank, BLZ: 10070024, KTO: 0810929 >>> Schoenhauser Allee 51, 10437 Berlin >>> >> >