Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A0DCF429E40 for ; Tue, 26 Apr 2011 16:55:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m+PmN0x9hGd6 for ; Tue, 26 Apr 2011 16:55:18 -0700 (PDT) Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DF3BC429E38 for ; Tue, 26 Apr 2011 16:55:17 -0700 (PDT) Received: by qwb7 with SMTP id 7so620353qwb.26 for ; Tue, 26 Apr 2011 16:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=EjJ4vnb9hXGGI6Eb1w4dCM2cxjd38673LrC6uXhgFCY=; b=Z5bJEunGjrYF+j0ZatdDDZ8aWAZE+l7ioOsqDUVqwNB/JkUuz1ZSJFKhNRqa6pNl3v Y9KarVCf5jaZQNKfB4gosKP8jnoyWl3QQtuOHfqjEWJJ78iekM62fgELebqZkFp18F9c r9thwdTVY2IULmlAj5ac+vEE4ZbQulgOY7THc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=SfXjiwfQ1D03bBmSa2braitVrfn+lgGxhFhyge0DzfTAR8TDshIPr7hrzwqQbRlRiO GO5smB1/LfqH+CawIm273XCpyJbSObDUKHgSyc4/8aJbk7RAgZpSUgEXBNTyOLoOw9eK XXMolHxqFCBkVmHCs84QvvlQpRYdSPduijO+A= MIME-Version: 1.0 Received: by 10.229.131.23 with SMTP id v23mr1156475qcs.11.1303862114636; Tue, 26 Apr 2011 16:55:14 -0700 (PDT) Sender: amdragon@gmail.com Received: by 10.229.220.148 with HTTP; Tue, 26 Apr 2011 16:55:14 -0700 (PDT) In-Reply-To: <87fwp4tzvd.fsf@eve.chaoflow.net> References: <87fwp4tzvd.fsf@eve.chaoflow.net> Date: Tue, 26 Apr 2011 19:55:14 -0400 X-Google-Sender-Auth: vDvm2-1VvfQL05K9buv_ZQQwFoU Message-ID: Subject: Re: doc: notmuch help search-terms, boolean operators From: Austin Clements To: Florian Friesdorf Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 23:55:18 -0000 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.le= mony, 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 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=3Dmessages` 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 > =A0GPG FPR: 7A13 5EEE 1421 9FC2 108D =A0BAAF 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 > >