Re: [PATCH 4/5] lib: query make exclude handling non-destructive

Subject: Re: [PATCH 4/5] lib: query make exclude handling non-destructive

Date: Tue, 06 Sep 2016 07:39:53 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


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.


Thread: