From user-return-5076-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Jun 10 16:25:11 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 83441 invoked from network); 10 Jun 2009 16:25:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jun 2009 16:25:11 -0000 Received: (qmail 83446 invoked by uid 500); 10 Jun 2009 16:25:22 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 83389 invoked by uid 500); 10 Jun 2009 16:25:21 -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 83379 invoked by uid 99); 10 Jun 2009 16:25:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 16:25:21 +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 bchesneau@gmail.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; Wed, 10 Jun 2009 16:25:11 +0000 Received: by fg-out-1718.google.com with SMTP id l27so1548634fgb.3 for ; Wed, 10 Jun 2009 09:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nCeW0DWIq/WMoGHxD3brBLOuBZbKxlsZJrcSDGl1RhE=; b=Cb/5M5gq3sWHd+9B/yGANFcGnH2+UAMDAYVC0AKzFRsAbHd1LlpNffjiyt9pkd5NGE wEs7jfjhjr6zvAUlRKGE/gwqzmHluIuhorpyePQTI5ufNu3gWOfELN+UEqRj1StxcMHq t7+CZFxZqgbcY9M2qJTGT7hbjlqX+jABRgppY= 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:content-transfer-encoding; b=NgcPe5fE/hCNNocX2SsyhSrpzbMYOyNdkr9i6OOA05qB1h6Es8iVWpJWWvQwQjSHTN h2Hp6myW9g3/UzmvgMGJthmH6rZz8oeIvCmFuUqEKLZRvAJYXcXSgs6EPvUq2rHexERU Sfl1stPDYgS5zfbdEaAZ2YXRxerSSr3eOLQQU= MIME-Version: 1.0 Received: by 10.86.65.9 with SMTP id n9mr1249090fga.47.1244651091292; Wed, 10 Jun 2009 09:24:51 -0700 (PDT) In-Reply-To: References: Date: Wed, 10 Jun 2009 18:24:51 +0200 Message-ID: Subject: Re: calulate doc popularity with couchdb map/reduce From: Benoit Chesneau To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 2009/6/10 Chris Anderson : > On Wed, Jun 10, 2009 at 6:06 AM, Benoit Chesneau wro= te: > > It looks like you are building up a hash of scores in your reduce. Can > you get the same results by keeping the reduce ignorant of keys, and > just calculating the score for whatever keys are in the range. Then > you can use a group query and sort by value on the client. > > Anything involving relative popularity of certain items will have a > sorting phase outside of CouchDB's first pass of map reduce. > hi, thanks for the feedback. I think you mean somethink like this : http://www.friendpaste.com/4cIo2tzKA3epiwLkwPsolA It works yes, but now I need a second phase to invert values/keys and get them in right order. In fact having the possibility to save resukt of first reduce in temporary docs and mapping them to a new result could be a solution. - beno=EEt