Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 84801 invoked from network); 2 Aug 2009 07:42:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Aug 2009 07:42:45 -0000 Received: (qmail 54969 invoked by uid 500); 2 Aug 2009 07:42:48 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 54878 invoked by uid 500); 2 Aug 2009 07:42:48 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 54868 invoked by uid 99); 2 Aug 2009 07:42:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Aug 2009 07:42:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Aug 2009 07:42:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CC3C3234C004 for ; Sun, 2 Aug 2009 00:42:14 -0700 (PDT) Message-ID: <148526214.1249198934823.JavaMail.jira@brutus> Date: Sun, 2 Aug 2009 00:42:14 -0700 (PDT) From: "Paul Joseph Davis (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-415) View sorting In-Reply-To: <1223640228.1247732955183.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738008#action_12738008 ] Paul Joseph Davis commented on COUCHDB-415: ------------------------------------------- Just realized that my old patch may not be the entire answer to this. For reference, the old patch only allows specifying forward or reverse sorting for array key elements at definition time. Nils here apparently wants to select a range of rows by endtime and then resort based on starttime. My patch would only give "sort by end time asc, sort by startime asc within endtime keys". Think simple Excel sort by multiple columns type sorting here. That said, the patch itself isn't too hard. > View sorting > ------------ > > Key: COUCHDB-415 > URL: https://issues.apache.org/jira/browse/COUCHDB-415 > Project: CouchDB > Issue Type: Wish > Affects Versions: 0.9 > Reporter: Nils Breunese > > I'd like to be able to sort the output of a view. I have a view that generates a list of event objects with start and end timestamps (and some other data). I emit this data using the end timestamp as the key, because that is what I want to use for my ?startkey=... query. But I'd like the results to be sorted by the start timestamp. I understand this is not currently possible using regular CouchDB views. > The CouchDB Users mailinglist suggested to use couchdb-lucene, as that does offer the option to sort on any indexed field. I'm trying that route now, but it feels like overkill to add a full-text indexer to CouchDB just to be able to sort the output of my view. > Some soundbites from the IRC channel when I brought this up: > ---- > breun: jan___: in this case the data to sort on is known at map time, so an extension to emit to support multiple keys (with separate btrees) would do it. not sure how much effort that is, though. > sorting at query time feels infeasible. > rnewson: I think davisp had something like that working back in the day. i.e. alternate sort oder. davisp? > jan___: I missed that, but it sounds reasonable at emit time. > I think its this one: http://github.com/davisp/couchdb-old-patches/tree/view-sort > ---- > I would love to have view sorting native in CouchDB. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.