unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: Re: [PATCH 4/5] lib: query make exclude handling non-destructive
Date: Tue, 06 Sep 2016 07:39:53 -0300	[thread overview]
Message-ID: <878tv5ia6e.fsf@zancas.localnet> (raw)
In-Reply-To: <20160905154806.4570-5-david@tethera.net>

David Bremner <david@tethera.net> 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.

  reply	other threads:[~2016-09-06 10:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 15:48 Fix count/search query destructiveness David Bremner
2016-09-05 15:48 ` [PATCH 1/5] lib: eagerly parse queries David Bremner
2016-09-05 15:48 ` [PATCH 2/5] lib/query: make query parsing lazy again, keep centralized David Bremner
2016-09-05 15:48 ` [PATCH 3/5] test: add known broken test for nondestructiveness of count David Bremner
2016-09-05 15:48 ` [PATCH 4/5] lib: query make exclude handling non-destructive David Bremner
2016-09-06 10:39   ` David Bremner [this message]
2016-09-05 15:48 ` [PATCH 5/5] lib: make notmuch_query_add_tag_exclude return a status value David Bremner
2016-09-06 11:20   ` David Bremner
2016-09-06 10:37 ` Fix count/search query destructiveness David Bremner
  -- strict thread matches above, loose matches on Subject: below --
2016-10-02  2:13 V2 non-destructive excludes David Bremner
2016-10-02  2:13 ` [PATCH 4/5] lib: query make exclude handling non-destructive David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878tv5ia6e.fsf@zancas.localnet \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).