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 3303A431FB6 for ; Wed, 4 May 2011 14:26:44 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 gqS-3mUm5fX3 for ; Wed, 4 May 2011 14:26:43 -0700 (PDT) Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU [18.7.68.35]) by olra.theworths.org (Postfix) with ESMTP id AF1D0431FB5 for ; Wed, 4 May 2011 14:26:43 -0700 (PDT) X-AuditID: 12074423-b7b68ae0000016f8-fd-4dc1c4923ec9 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id 28.33.05880.294C1CD4; Wed, 4 May 2011 17:26:42 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id p44LQfuu020265; Wed, 4 May 2011 17:26:42 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p44LQesd004944 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Wed, 4 May 2011 17:26:41 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72) (envelope-from ) id 1QHjae-0006tU-JQ; Wed, 04 May 2011 17:26:36 -0400 Date: Wed, 4 May 2011 17:26:36 -0400 From: Austin Clements To: Felipe Contreras Subject: Re: [PATCH v2] test/search: add check for slightly trick search Message-ID: <20110504212636.GP29861@mit.edu> References: <1304540796-8865-1-git-send-email-felipe.contreras@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEKsWRmVeSWpSXmKPExsUixCmqrDvpyEFfgzVnlCwOPs6zuH5zJrMD k8fOWXfZPZ6tusUcwBTFbZOUWFIWnJmep2+XwJ2xY/JqtoKN3BUb22eyNjDO4Oxi5OSQEDCR 2HvuNSOELSZx4d56ti5GLg4hgX2MEpOnnGWEcNYzSlzbPo8VwjnBJNG3aSpU2RJGibl7t7CB 9LMIqEh0dd9hAbHZBDQktu1fDjZXRMBQYm/7VLA4s4C0xLffzUwgtrCAh8Tqu79YQWxeAR2J k5t6odZtZ5TY+GYyM0RCUOLkzCdQzToSO7feAVrGATZo+T8OiLC8RPPW2WDlnAKOEkf3X2AH sUWB7rm2v51tAqPwLCSTZiGZNAth0iwkkxYwsqxilE3JrdLNTczMKU5N1i1OTszLSy3SNdPL zSzRS00p3cQIigV2F+UdjH8OKh1iFOBgVOLhfZd00FeINbGsuDL3EKMkB5OSKK/BYaAQX1J+ SmVGYnFGfFFpTmrxIUYJDmYlEd4dvUA53pTEyqrUonyYlDQHi5I471xJdV8hgfTEktTs1NSC 1CKYrAwHh5IE71qQoYJFqempFWmZOSUIaSYOThDBBbKBB2iDPkghb3FBYm5xZjpE0SlGRSlx 3ikgCQGQREZpHtwAWNJ6xSgO9I8w7wqQKh5gwoPrfgU0mAlosFfzAZDBJYkIKakGxoT/ux8q P2s+cTlz1dEwTvPkZh/vnwXHPTcWdss+URA5r1Je8eErU6ZO8aeNYic4VV2Wfb0xs1tRsNiu VFzsrvJ7jTmqwjJFbLO6IiZ/cBT6Uj+x7pr+LS2vRWfub7nYOnHB82dpDW9y3kmesfM/UftH 4vZCmYJFx39/ZOjkKMxf1296yrO7T4mlOCPRUIu5qDgRABO3RC01AwAA 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: Wed, 04 May 2011 21:26:44 -0000 Quoth Felipe Contreras on May 04 at 11:54 pm: > On Wed, May 4, 2011 at 11:46 PM, Austin Clements wrote: > > On Wed, May 4, 2011 at 4:26 PM, Felipe Contreras > > wrote: > >> +output=$(notmuch search from:'search-by-from@' | notmuch_search_sanitize) > > > > I don't think this does what you think it does.  Xapian only > > understands double quotes around phrases, not single quotes. > > Furthermore, a single quote after a prefix prevents that token from > > acting as a prefix, so you search is finding messages containing the > > *word* "from" and the phrase "search by from" *anywhere* (which is a > > phrase not because of the quotes, but because of the hyphens). > > > > The test results happen to be the same if you use single quotes or > > double quotes, but for very different reasons. > > Ok, how about: > search from:search-by-from@ > > Would that be better? from:"search-by-from@" would be the fail-safe, since that's clearly a prefixed phrase query in Xapian syntax. from:search-by-from@ depends on the parsing of @, which is precisely what I think you're proposing should be changed (though your commit message talks about hyphens, not @), so in some sense from:search-by-from@ is up to you. It probably *should* work, given that @ happens to be classified the same way as hyphen by the Xapian parser (or, in the custom query parser, because @ isn't whitespace).