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 4CFCD6DE0243 for ; Tue, 6 Sep 2016 03:39:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=0.004, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 1vzOYSEEylEb for ; Tue, 6 Sep 2016 03:39:56 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id B1FE56DE00E8 for ; Tue, 6 Sep 2016 03:39:56 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1bhDnC-0006Yz-O5; Tue, 06 Sep 2016 06:39:50 -0400 Received: (nullmailer pid 21209 invoked by uid 1000); Tue, 06 Sep 2016 10:39:53 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [PATCH 4/5] lib: query make exclude handling non-destructive In-Reply-To: <20160905154806.4570-5-david@tethera.net> References: <20160905154806.4570-1-david@tethera.net> <20160905154806.4570-5-david@tethera.net> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 06 Sep 2016 07:39:53 -0300 Message-ID: <878tv5ia6e.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Tue, 06 Sep 2016 10:39:57 -0000 David Bremner writes: > + > + /* apparently Xapian doesn't support skip_to on terms from a query, > + so cache a copy of all terms in something searchable */ The terms are not sorted, but rather returned in occurence order, so this really is needed; the comment should be updated to not suggest a bug in Xapian ;). > + > + for (Xapian::TermIterator t = query->xapian_query.get_terms_begin(); > + t != query->xapian_query.get_terms_end(); ++t) > + query->terms.insert(*t); we ought to insert query->parsed = TRUE to prevent the query from being parsed over and over again.