Re: emacs-notmuch: A Xapian exception occurred parsing query

Subject: Re: emacs-notmuch: A Xapian exception occurred parsing query

Date: Wed, 07 Feb 2018 06:58:38 -0400

To: Kai Wang, notmuch@notmuchmail.org

Cc:

From: David Bremner


Kai Wang <kaiwkx@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
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: