[Xapian-tickets] [Xapian] #447: QueryParser: Confusion with Boolean term and -.
Xapian
nobody at xapian.org
Thu Feb 11 23:29:56 GMT 2010
#447: QueryParser: Confusion with Boolean term and -.
--------------------+-------------------------------------------------------
Reporter: cworth | Owner: olly
Type: defect | Status: new
Priority: normal | Milestone:
Component: Other | Version: 1.1.3
Severity: normal | Blockedby:
Platform: All | Blocking:
--------------------+-------------------------------------------------------
Here's a query string handled just fine by the query parser:
tag:foo and tag:deleted
which expands (in notmuch) to:
Xapian::Query((Tmail AND 0 * Kfoo AND 0 * Kdeleted))
Meanwhile, this very similar query string (adding only -):
tag:foo and -tag:deleted
instead expands to:
Xapian::Query((Tmail AND (Zand:(pos=1) FILTER (Kfoo OR
Kdeleted))))
Note that things have gone quite insane here, (with the Boolean
operator now being treated as a term). This seems to happen whenever a
Boolean operator appears adjacent to a word starting with a
non-alphabetic character, (but I haven't characterized the bug
perfectly yet).
The same bug occurs with the operator in all caps (AND).
Here are the flags that notmuch is passing to the query parser:
(Xapian::QueryParser::FLAG_BOOLEAN |
Xapian::QueryParser::FLAG_PHRASE |
Xapian::QueryParser::FLAG_LOVEHATE |
Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE |
Xapian::QueryParser::FLAG_WILDCARD |
Xapian::QueryParser::FLAG_PURE_NOT)
I'd love to hear any ideas, and especially a fix of course. :-)
-Carl
--
Ticket URL: <http://trac.xapian.org/ticket/447>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list