Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 4F76F4196F0 for ; Thu, 15 Apr 2010 05:54:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[BAYES_40=-0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o6dUQFlxMcWp for ; Thu, 15 Apr 2010 05:54:13 -0700 (PDT) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by olra.theworths.org (Postfix) with ESMTP id 823AA431FC1 for ; Thu, 15 Apr 2010 05:54:13 -0700 (PDT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O2OaA-00036C-3E for notmuch@notmuchmail.org; Thu, 15 Apr 2010 14:54:11 +0200 Received: from ip-118-90-132-224.xdsl.xnet.co.nz ([118.90.132.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Apr 2010 14:54:10 +0200 Received: from olly by ip-118-90-132-224.xdsl.xnet.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Apr 2010 14:54:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: notmuch@notmuchmail.org From: Olly Betts Subject: Re: [PATCH] allow to not sort the search results Date: Thu, 15 Apr 2010 12:54:01 +0000 (UTC) Lines: 33 Message-ID: References: <1271226655-5672-1-git-send-email-Sebastian@SSpaeth.de> <20100414065525.GA11770@jdc.jasonjgw.net> <87hbnebhg0.fsf@SSpaeth.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 118.90.132.224 (Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.9) Gecko/20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9) X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Thu, 15 Apr 2010 12:54:15 -0000 Sebastian Spaeth writes: > On 2010-04-14, Jason White wrote: > > > Also add a --sort=unsorted command line option to notmuch search to test > > > this. > > > > Does this provide relevance-ranked search results? I think relevance ranking > > is the Xapian default if a sort order isn't specified. > > Yes, by default it is using sort_by_relevance, so "unsorted" implies > just that. (in fact, a previous incarnation of this patch called it > --sort=relevance) Except notmuch (at least in the code I've looked at) sets the weighting scheme to BoolWeight, so the ordering is actually just the raw docid ordering (BoolWeight gives all matching docs a weight of 0). > I would be happy to have it called --sort=relevance too, the unsorted > points out potential performance improvements a bit better, IMHO > (although they seem to be really small with a warm cache). When using the results of a search to add/remove tags, there's likely to be an additional win from --sort=unsorted as documents will now be processed in docid order which will tend to have a more cache friendly locality of access. Also, sorting by relevance requires more calculations and may require fetching additional data (document length for example). So I think it would make sense for --sort=relevance and --sort=unsorted to be separate options. Cheers, Olly