emacs-notmuch: A Xapian exception occurred parsing query

David Bremner david at tethera.net
Wed Feb 7 02:58:38 PST 2018


Kai Wang <kaiwkx at gmail.com> writes:

> When I use emacs-notmuch, in the notmuch-search mode, I press 't' and
> select a tag, it gives a parsing query error:
>
> ======================================================================
>
> [Tue Feb  6 10:41:04 2018]
> notmuch search: A Xapian exception occurred
> A Xapian exception occurred parsing query: Syntax: <expression> AND <expression>
> Query string was: * and tag:flagged
> command: /usr/local/bin/notmuch search --format\=sexp --format-version\=4 --sort\=newest-first \*\ and\ tag\:flagged
> exit status: 1
> stderr:
> notmuch search: A Xapian exception occurred
> A Xapian exception occurred parsing query: Syntax: <expression> AND <expression>
> Query string was: * and tag:flagged
>

Hi Kai;

Thanks for the report.  This is a more or less known problem with "*";
if you try 't' in any other search it should work.

The underlying issue is that * is parsed (simplistically) by notmuch
before passing to Xapian, so only works if it is the entire query.

For cases like you report, where the user has not entered '*', but
rather it is contained in some generated query string, we could fix the
problem by adding a prefix like "special:*". This would allow Xapian to
parse it, but only for Xapian versions >= 3.5.  How many users of older
systems do we think this would affect? E.g. users of Debian oldstable
(jessie) would have to compile Xapian in order to use the newest
notmuch.

d


More information about the notmuch mailing list