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.