From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 0DCBE6DE01EC for ; Sun, 30 Sep 2018 02:12:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.112 X-Spam-Level: X-Spam-Status: No, score=-0.112 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bAMmxkJNl-qu for ; Sun, 30 Sep 2018 02:12:56 -0700 (PDT) X-Greylist: delayed 1336 seconds by postgrey-1.36 at arlo; Sun, 30 Sep 2018 02:12:55 PDT Received: from thyestes.tartarus.org (thyestes.tartarus.org [5.196.91.86]) by arlo.cworth.org (Postfix) with ESMTPS id DDC066DE0151 for ; Sun, 30 Sep 2018 02:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tartarus.org; s=20161122; h=To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VKduMA/iZvuGrAWjxuZ/MU1ZObSyTs0ieEARwK8U8o8=; b=SL/ZdDDn+jmzXxWDSTIZz8n9O EkhQw9FNm5eJWlHHchjMBOzKZT0a/liEmKo92Y6hke4owq/EjSpfJYhf2Y2ULFQS3tH99e8FW0xoW yAGD6N4jU4GYNYnfeltv9A9arFZVSzKf6h/uQmJR5gQId0/w59AUADMGE73i88I01V9AaBa5eKtNw vm7MxUlqYugGDlMRjnaMnYl33DuU0sMSdhlo3LPEX6alGitGGQ/aOniyMQ2Bum1hzd8jD3K8Cx414 nGYsUVxEP7WsQ2h939JH5d9eABkDZqNCC8ccdpjXLRmxGRbCyukIfwXXpKyb9juFaVNcEyX+MZ/Ox kgFjFhDvw==; Received: from [88.98.205.179] (helo=[172.22.198.104]) by thyestes.tartarus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6XQs-0001Ml-7r; Sun, 30 Sep 2018 09:50:31 +0100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: xapian parser bug? From: James Aylett In-Reply-To: <87a7o02bya.fsf@tethera.net> Date: Sun, 30 Sep 2018 09:50:30 +0100 Cc: xapian-discuss@lists.xapian.org, notmuch@notmuchmail.org X-Mao-Original-Outgoing-Id: 559990229.787106-66839e86e6db142bef0a67a2f98e22d5 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87a7o02bya.fsf@tethera.net> To: David Bremner X-Mailer: Apple Mail (2.3273) X-Mailman-Approved-At: Sun, 30 Sep 2018 04:02:53 -0700 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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: Sun, 30 Sep 2018 09:12:57 -0000 David =E2=80=94 this isn't the behaviour I see what QueryParser alone, = unless you're driving it in a way I don't expect. In python: >>> import xapian >>> qp =3D xapian.QueryParser() >>> qp.add_prefix('subject', 'S') >>> str(qp.parse_query('subject:"and"', = qp.FLAG_DEFAULT|qp.FLAG_BOOLEAN_ANY_CASE)) 'Query(Sand@1)' >>> str(qp.parse_query('subject:"or"', = qp.FLAG_DEFAULT|qp.FLAG_BOOLEAN_ANY_CASE)) 'Query(Sor@1)' >>> str(qp.parse_query('subject:"not"', = qp.FLAG_DEFAULT|qp.FLAG_BOOLEAN_ANY_CASE)) 'Query(Snot@1)' >>> str(qp.parse_query('subject:" not "', = qp.FLAG_DEFAULT|qp.FLAG_BOOLEAN_ANY_CASE)) 'Query(Snot@1)' Note that I'm using 1.4.7, and from your output I believe you're not = (the * in the query description I believe doesn't happen in those = situations any more). J > On 29 Sep 2018, at 23:09, David Bremner wrote: >=20 >=20 > Today we noticed that keywords can't be searched as prefixed terms. Or > that's what it looks like anyway. I tested and, or, and not. >=20 > =E2=95=B0=E2=94=80% NOTMUCH_DEBUG_QUERY=3Dy notmuch search = 'subject:"and"' > Query string is: > subject:"and" > notmuch search: A Xapian exception occurred > A Xapian exception occurred parsing query: Syntax: AND = > Query string was: subject:"and" >=20 > =E2=95=B0=E2=94=80% NOTMUCH_DEBUG_QUERY=3Dy notmuch search = 'subject:"or"'=20 > Query string is: > subject:"or" > notmuch search: A Xapian exception occurred > A Xapian exception occurred parsing query: Syntax: OR = > Query string was: subject:"or" >=20 > =E2=95=B0=E2=94=80% NOTMUCH_DEBUG_QUERY=3Dy notmuch search = 'subject:"not"' > Query string is: > subject:"not" > notmuch search: A Xapian exception occurred > A Xapian exception occurred parsing query: Syntax: NOT = > Query string was: subject:"not" >=20 > Interestingly, putting space around the operator seems to be a > workaround. Something about turning on phrase parsing maybe? >=20 > =E2=95=B0=E2=94=80% NOTMUCH_DEBUG_QUERY=3Dy notmuch count 'subject:" = not "' > Query string is: > subject:" not " > Exclude query is: > Query((((Kspam OR Kdeleted) OR Kmuted) OR Kbad-address)) > Final query is: > Query(((Tmail AND 0 * XSUBJECTnot@1) AND_NOT (((Kspam OR Kdeleted) OR = Kmuted) OR Kbad-address))) > 9927 >=20 --=20 James Aylett devfort.com =E2=80=94 spacelog.org =E2=80=94 tartarus.org/james/