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 BFEDA4196F0 for ; Thu, 15 Apr 2010 23:58:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.301 X-Spam-Level: X-Spam-Status: No, score=-2.301 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, RCVD_IN_DNSWL_MED=-2.3] 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 5j1bxmfC8FfC for ; Thu, 15 Apr 2010 23:58:15 -0700 (PDT) Received: from atreus.tartarus.org (atreus.tartarus.org [80.252.125.10]) by olra.theworths.org (Postfix) with ESMTP id B24A7431FC1 for ; Thu, 15 Apr 2010 23:58:15 -0700 (PDT) Received: from olly by atreus.tartarus.org with local (Exim 4.69) (envelope-from ) id 1O2fVG-00041o-3F; Fri, 16 Apr 2010 07:58:14 +0100 Date: Fri, 16 Apr 2010 07:58:14 +0100 From: Olly Betts To: Sebastian Spaeth Subject: Re: [PATCH] allow to not sort the search results Message-ID: <20100416065814.GO10323@survex.com> References: <1271226655-5672-1-git-send-email-Sebastian@SSpaeth.de> <20100414065525.GA11770@jdc.jasonjgw.net> <87hbnebhg0.fsf@SSpaeth.de> <87eiifj433.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87eiifj433.fsf@SSpaeth.de> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: notmuch@notmuchmail.org 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: Fri, 16 Apr 2010 06:58:17 -0000 On Fri, Apr 16, 2010 at 08:37:04AM +0200, Sebastian Spaeth wrote: > On 2010-04-15, Olly Betts wrote: > > 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. > > Now I am a bit confused. The API docs state that sort_by_relevance is > the default. So by skipping any sort_by_value() will that incur the additional > calculations (with our BoolWeight set?). All I want is the fasted way > to return a searched set of docs :-). Yes, sort_by_relevance() is the default. But if you set BoolWeight as the weighting scheme then the relevance is simply zero, and Xapian doesn't have to fetch any statistics and calculate a score from them. When documents have exactly equal relevance weight, then the docid order is used. So although sort_by_relevance() is technically still on with BoolWeight, by "sorting by relevance" I wasn't talking about this case. So --sort=unsorted and --sort=relevance would only differ in code by the former setting BoolWeight and the latter not. Cheers, Olly