Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 3001 invoked from network); 3 Apr 2009 21:21:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Apr 2009 21:21:49 -0000 Received: (qmail 91676 invoked by uid 500); 3 Apr 2009 21:21:48 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 91598 invoked by uid 500); 3 Apr 2009 21:21:48 -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 91588 invoked by uid 99); 3 Apr 2009 21:21:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 21:21:48 +0000 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 jchris@gmail.com designates 74.125.78.24 as permitted sender) Received: from [74.125.78.24] (HELO ey-out-2122.google.com) (74.125.78.24) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 21:21:40 +0000 Received: by ey-out-2122.google.com with SMTP id 25so253835eya.29 for ; Fri, 03 Apr 2009 14:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=X+fVwMDtYFhc86xXYnD88d3Z+MXhI5AY1+vzDtAz6h0=; b=Xuu/NMkTCv/IT7W5GnEBEUYtDgMHXXRglQhPxl/6/I4OnttjCLskTvnQbLDV8oCWoS 3AT5y9qS9NENiSZDdHZPIBDuZmFi5iQJxK9ifEiZ9tx2j8x7On942SybGLlWcid9+sez jDY8r7E9yVBn6gMz6+5JxPnMJolXp27PeR4sI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=kP8h5GY3Fl9MOsnD/dWeqHspBnK92wJsGv/I5BCPI/zw81TzvxywT8HbFHHUrEnO5C Z7nmqU0R9tBWRVvZ3g3yxsuYXmvpsNcTlyHLxytPcZjuJ9sVSAhTHNtVJpNcJ9yNZSkI w+73+Nl+rY66z8qOrzCtPZp/uYlwOu7OPQdH4= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.210.40.10 with SMTP id n10mr1220510ebn.71.1238793677811; Fri, 03 Apr 2009 14:21:17 -0700 (PDT) In-Reply-To: References: <4b307fd10904031357s683fa560oe8fc96e43febca68@mail.gmail.com> Date: Fri, 3 Apr 2009 14:21:17 -0700 X-Google-Sender-Auth: e7e7ac02a4758cc9 Message-ID: Subject: Re: sorting by reduce value From: Chris Anderson 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 On Fri, Apr 3, 2009 at 2:01 PM, Paul Davis wr= ote: > Nope. There's nothing in CouchDB that allows for this yet. Different > methods have been discussed for adding it via things like a value > index to allow for users to selectively choose how things are sorted > in the output but noone's stepped up with an implementation yet. > I think the simplest path would be to "print" the results of a group=3Dtrue or group_level query to a secondary database. Keeping it incremental is the challenge. > HTH, > Paul Davis > > On Fri, Apr 3, 2009 at 4:57 PM, Nicolas Clairon wrote= : >> Hi ! >> >> I'm getting through a sorting issue with couchdb. >> >> Let's say we have a classic map/reduce for counting the number of >> documents by type : >> >> function(doc){ >> =A0emit(doc.doc_type, 1); >> } >> >> function(key, values){ >> =A0 return sum(values); >> } >> >> the results would be : >> >> type1 =3D> 3 >> type2 =3D> 1 >> type3 =3D> 2 >> ... >> >> My question is simple : How can we sort the result by the compute reduce= value ? >> We can sort by key, but can we sort by value ? >> >> Regards, >> >> Nicolas >> > --=20 Chris Anderson http://jchrisa.net http://couch.io