From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 10FAD6DE0196 for ; Sat, 20 Oct 2018 04:44:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.004 X-Spam-Level: X-Spam-Status: No, score=0.004 tagged_above=-999 required=5 tests=[AWL=0.005, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tseeadlUSTnT for ; Sat, 20 Oct 2018 04:43:59 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id AC8186DE0141 for ; Sat, 20 Oct 2018 04:43:59 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1gDpfg-0007DH-1Q; Sat, 20 Oct 2018 07:43:56 -0400 Received: (nullmailer pid 29604 invoked by uid 1000); Sat, 20 Oct 2018 11:43:54 -0000 From: David Bremner To: William Casarin , notmuch@notmuchmail.org Subject: Re: Proposed New sort API In-Reply-To: <87d0sj6cr6.fsf@jb55.com> References: <20171210154956.4049-1-david@tethera.net> <87d0sj6cr6.fsf@jb55.com> Date: Sat, 20 Oct 2018 08:43:54 -0300 Message-ID: <87lg6su9l1.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2018 11:44:01 -0000 William Casarin writes: > David Bremner writes: > >> I started looking at William's sorting patches [1], but the >> proliferation of sorting options bugged me a bit. I decided to sketch >> out a new more flexible API. >> >> In the new API, there is is a sort "key", currently mapped one-to-one >> to value slots, but potentially could do more sophisticated things >> like making keys up dynamically (e.g. preprocessing subjects). >> >> The second parameter is a sort "type". Currently this is just >> ascending or descending, but other potential options include >> sort_by_relevance_then_value > > > Another thought I had that I wanted to throw out there for > consideration. It would be nice to be able to sort by "popular" threads, > aka sort by the number of messages in each thread. Not sure if this is > an easy thing to do at the query level? I don't see how to manage it as a xapian query. In the current database schema xapian doesn't really know about threads, except that messages know what thread they belong to.