From: Suvayu Ali Date: Sat, 18 Jul 2015 15:32:39 +0000 (+0200) Subject: Re: Searching for phrases in the body of an email X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7582a444e87dce17c06fe2853162298a63484f96;p=notmuch-archives.git Re: Searching for phrases in the body of an email --- diff --git a/5f/6aa5827d149a1172cdff0ae47cf0879bb3fe08 b/5f/6aa5827d149a1172cdff0ae47cf0879bb3fe08 new file mode 100644 index 000000000..d132e10dc --- /dev/null +++ b/5f/6aa5827d149a1172cdff0ae47cf0879bb3fe08 @@ -0,0 +1,111 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 922686DE0AF8 + for ; Sat, 18 Jul 2015 08:32:48 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.719 +X-Spam-Level: +X-Spam-Status: No, score=-0.719 tagged_above=-999 required=5 tests=[AWL=0.101, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, + SPF_PASS=-0.001] 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 DXG6zLX7n3Rr for ; + Sat, 18 Jul 2015 08:32:46 -0700 (PDT) +Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com + [209.85.212.169]) + by arlo.cworth.org (Postfix) with ESMTPS id 4BCCB6DE0352 + for ; Sat, 18 Jul 2015 08:32:46 -0700 (PDT) +Received: by wibud3 with SMTP id ud3so58512508wib.1 + for ; Sat, 18 Jul 2015 08:32:43 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=sender:date:from:to:subject:message-id:mail-followup-to:references + :mime-version:content-type:content-disposition:in-reply-to + :user-agent; bh=lwnP4K3WOFxVB8WU8LVYanT4CSUezjuuf9R0FhB0vR4=; + b=rF5OMOXwiL2nf2psVvJ5c4fmZS3i+REWtUpIOCKYsgW8fFZILeRrVMp7iadAch+15v + T2WJQDMA/I3iRHp3W2QJ6Q0Ffq8oUlFSh9wUj+uHxtGkXPokN1lK76PGdsAxDg3RXBBh + 7s1KIZVh+Gz5q+olwb393rpSYwkgCHXEMOm7uZOXZH2Wqvx0g/PS8InGqsjDO6kaItHJ + h7/0YstPsb0quy/86JVAMYA3jf03CJDBjFnxuWZGUknvP2mlP5+X1R5OmysWYwkCMG0G + TLoj2OBpVRa1UxbbIc8Mq1mXd7cQNVEnQD/QJK6wlFWZ3Pw1rNZVxew4R7Lqex+pPXf3 + q6FA== +X-Received: by 10.180.102.233 with SMTP id fr9mr5768851wib.3.1437233562072; + Sat, 18 Jul 2015 08:32:42 -0700 (PDT) +Received: from chitra.no-ip.org (ip82-139-115-46.lijbrandt.net. + [82.139.115.46]) + by smtp.gmail.com with ESMTPSA id l14sm23178123wjq.21.2015.07.18.08.32.40 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sat, 18 Jul 2015 08:32:41 -0700 (PDT) +Sender: Suvayu Ali +Date: Sat, 18 Jul 2015 17:32:39 +0200 +From: Suvayu Ali +To: notmuch@notmuchmail.org +Subject: Re: Searching for phrases in the body of an email +Message-ID: <20150718153239.GB4527@chitra.no-ip.org> +Mail-Followup-To: notmuch@notmuchmail.org +References: <20150717121111.GF25651@chitra.no-ip.org> + <55A923E9.5070509@imca-cat.org> + <20150718091139.GB8311@chitra.no-ip.org> + +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: + +User-Agent: Mutt/1.5.23.1 (2014-03-12) +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Sat, 18 Jul 2015 15:32:48 -0000 + +Hi Xu, + +On Sat, Jul 18, 2015 at 10:54:30AM -0400, Xu Wang wrote: +> +> First note that I believe notmuch search is case insensitive by +> default, so your grep should be case insensitive as well. + +Good point, I tried that, didn't change the numbers much. The number of +matches from grep went up to 24, whereas notmuch count says 463. + +> More importantly, I'm not sure how 'no NEAR "plain text" ' syntax is +> parsed. Maybe it is parsed as {no NEAR plain} or {text}. +> + +Exactly, that's what I do not understand. + +> You would like to search for the exact phrase, correct? How about the +> following? +> +> notmuch search no adj plain adj text + +Good suggestion. I tried it, and gives me very consistent numbers: + +$ notmuch count -- no ADJ plain ADJ text +20 +$ notmuch show -- $(notmuch search --output=messages -- no NEAR \"plain\ text\") | \ + grep -c -iE 'plain[[:space:]/]+text' +24 + +Of course this does not help me solve my original goal, but I guess now +I can try different queries based on your idea. + +Thanks a lot! + +-- +Suvayu + +Open source is the future. It sets us free.