doc: notmuch help search-terms, boolean operators

2011-04-27 Thread Olly Betts
On Tue, Apr 26, 2011 at 04:01:17PM -0700, Carl Worth wrote:
> On Wed, 27 Apr 2011 00:24:38 +0200, Florian Friesdorf  
> wrote:
> > 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.
> 
> Currently, notmuch doesn't implement this behavior but relies on
> Xapian's query parser to do so. As such, I'd really prefer to see
> Xapian's documentation augmented here before we start documenting
> any particular behavior in notmuch.
> 
> Olly, is the above list of operators complete and in the correct order
> of  precendence?

Close, but actually AND and NOT have equal precedence.

Also, NEAR and ADJ bind tighter than AND or NOT.

And '+' and '-' tightest of all.

I'll try to make sure this gets documented.

Cheers,
Olly


doc: notmuch help search-terms, boolean operators

2011-04-27 Thread Florian Friesdorf

`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 
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Austin Clements
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 at 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  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 
> ?GPG FPR: 7A13 5EEE 1421 9FC2 108D ?BAAF 38F8 99A3 0C45 F083
> Jabber/XMPP: flo at chaoflow.net
> IRC: chaoflow on freenode,ircnet,blafasel,OFTC
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>
>


Re: doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Austin Clements
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@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  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 
>  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
> Jabber/XMPP: f...@chaoflow.net
> IRC: chaoflow on freenode,ircnet,blafasel,OFTC
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>
>
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Olly Betts
On Tue, Apr 26, 2011 at 04:01:17PM -0700, Carl Worth wrote:
> On Wed, 27 Apr 2011 00:24:38 +0200, Florian Friesdorf  
> wrote:
> > 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.
> 
> Currently, notmuch doesn't implement this behavior but relies on
> Xapian's query parser to do so. As such, I'd really prefer to see
> Xapian's documentation augmented here before we start documenting
> any particular behavior in notmuch.
> 
> Olly, is the above list of operators complete and in the correct order
> of  precendence?

Close, but actually AND and NOT have equal precedence.

Also, NEAR and ADJ bind tighter than AND or NOT.

And '+' and '-' tightest of all.

I'll try to make sure this gets documented.

Cheers,
Olly
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Jameson Graef Rollins
On Tue, 26 Apr 2011 16:01:17 -0700, Carl Worth  wrote:
> > Complete list of boolean operators in order of precedence:
> > - NOT
> > - AND
> > - XOR
> > - OR
> > 
> > Is this correct? If yes, I would extend the manpage accordingly.
> 
> Currently, notmuch doesn't implement this behavior but relies on
> Xapian's query parser to do so. As such, I'd really prefer to see
> Xapian's documentation augmented here before we start documenting
> any particular behavior in notmuch.

It would be nice if the notmuch documentation did mention the available
operators, though.  For instance, I had no idea that XOR was a supported
operator.

jamie.


pgpedlE06aDY4.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Jameson Graef Rollins
On Tue, 26 Apr 2011 16:01:17 -0700, Carl Worth  wrote:
> > Complete list of boolean operators in order of precedence:
> > - NOT
> > - AND
> > - XOR
> > - OR
> > 
> > Is this correct? If yes, I would extend the manpage accordingly.
> 
> Currently, notmuch doesn't implement this behavior but relies on
> Xapian's query parser to do so. As such, I'd really prefer to see
> Xapian's documentation augmented here before we start documenting
> any particular behavior in notmuch.

It would be nice if the notmuch documentation did mention the available
operators, though.  For instance, I had no idea that XOR was a supported
operator.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Carl Worth
On Wed, 27 Apr 2011 00:24:38 +0200, Florian Friesdorf  wrote:
> I would like to replace the "etc" with a full list and document the
> operator precedence.

Yes, that's a fine idea.

> 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.

Currently, notmuch doesn't implement this behavior but relies on
Xapian's query parser to do so. As such, I'd really prefer to see
Xapian's documentation augmented here before we start documenting
any particular behavior in notmuch.

Olly, is the above list of operators complete and in the correct order
of  precendence?

-Carl

-- 
carl.d.wo...@intel.com


pgpqmGHDYaVPY.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Carl Worth
On Wed, 27 Apr 2011 00:24:38 +0200, Florian Friesdorf  
wrote:
> I would like to replace the "etc" with a full list and document the
> operator precedence.

Yes, that's a fine idea.

> 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.

Currently, notmuch doesn't implement this behavior but relies on
Xapian's query parser to do so. As such, I'd really prefer to see
Xapian's documentation augmented here before we start documenting
any particular behavior in notmuch.

Olly, is the above list of operators complete and in the correct order
of  precendence?

-Carl

-- 
carl.d.worth at intel.com
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



doc: notmuch help search-terms, boolean operators

2011-04-26 Thread Florian Friesdorf

`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 
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: f...@chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC


pgpsTdo4ATfrZ.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch