[PATCH 4/5] lib: query make exclude handling non-destructive
David Bremner
david at tethera.net
Tue Sep 6 03:39:53 PDT 2016
David Bremner <david at 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.
More information about the notmuch
mailing list