unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@mit.edu>
To: Florian Friesdorf <flo@chaoflow.net>
Cc: notmuch@notmuchmail.org
Subject: Re: doc: notmuch help search-terms, boolean operators
Date: Tue, 26 Apr 2011 19:55:14 -0400	[thread overview]
Message-ID: <BANLkTinG_DdR5gdPr7=YkESPpY+apdD+Tg@mail.gmail.com> (raw)
In-Reply-To: <87fwp4tzvd.fsf@eve.chaoflow.net>

The full precedence is rather complicated, once you include all Xapian
operators and exceptions.  See
http://trac.xapian.org/browser/trunk/xapian-core/queryparser/queryparser.lemony,
particularly starting at line 1560.  Your precedence list is mostly
right, except that AND and NOT have the same precedence (and are
disambiguated by left-associativity in binary situations).

I think the real question is what we *want* notmuch to support.  My
understanding from id:"8762rq8byr.fsf@yoom.home.cworth.org" is that
things like NEAR and ADJ were intentionally omitted from the
documentation; that while notmuch inherits them from the Xapian query
parser, they aren't considered part of the "notmuch" query syntax.  I
would also classify XOR as dubious (even the Xapian docs call it
esoteric), but I'm happy to be convinced otherwise.

I'd love to know what people want from the query syntax for the
purposes of trimming down the custom query parser patch, and it would
also answer what should be documented (the current "etc" in the
documentation is just asking for trouble!).  I would propose "and",
"or", "not", "-" (and maybe "+" for symmetry, even though it's a
no-op), brackets, phrases, and wildcards, but what do other people
think?

On Tue, Apr 26, 2011 at 6:24 PM, Florian Friesdorf <flo@chaoflow.net> wrote:
>
> `notmuch help search-terms` currently states: "In addition to
> individual terms, multiple terms can be combined with Boolean operators
> ("and", "or", "not", etc.).".
>
> I would like to replace the "etc" with a full list and document the
> operator precedence.
>
> In lib/notmuch.h for notmuch_query_create I found a pointer to xapian
> docs [2], which states that AND takes precedence over OR, but nothing
> for NOT and XOR.
>
> Through playing with `notmuch tag` and `notmuch search
> --output=messages` I found:
>
> Complete list of boolean operators in order of precedence:
> - NOT
> - AND
> - XOR
> - OR
>
> Is this correct? If yes, I would extend the manpage accordingly.
>
> [2] http://xapian.org/docs/queryparser.html
>
> --
> Florian Friesdorf <flo@chaoflow.net>
>  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
> Jabber/XMPP: flo@chaoflow.net
> IRC: chaoflow on freenode,ircnet,blafasel,OFTC
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>
>

      parent reply	other threads:[~2011-04-26 23:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 22:24 doc: notmuch help search-terms, boolean operators Florian Friesdorf
2011-04-26 23:01 ` Carl Worth
2011-04-26 23:11   ` Jameson Graef Rollins
2011-04-26 23:29   ` Olly Betts
2011-04-26 23:55 ` Austin Clements [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTinG_DdR5gdPr7=YkESPpY+apdD+Tg@mail.gmail.com' \
    --to=amdragon@mit.edu \
    --cc=flo@chaoflow.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).