Re: Searching for phrases in the body of an email
authorJani Nikula <jani@nikula.org>
Sat, 18 Jul 2015 15:53:53 +0000 (18:53 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:11 +0000 (14:49 -0700)
62/0ff230f75c6aa73f32df997b866660070629f4 [new file with mode: 0644]

diff --git a/62/0ff230f75c6aa73f32df997b866660070629f4 b/62/0ff230f75c6aa73f32df997b866660070629f4
new file mode 100644 (file)
index 0000000..2d481a0
--- /dev/null
@@ -0,0 +1,187 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 4FDC26DE0AF8\r
+ for <notmuch@notmuchmail.org>; Sat, 18 Jul 2015 08:54:00 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.603\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.603 tagged_above=-999 required=5 tests=[AWL=1.322, \r
+ HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, \r
+ RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id UGueViAVPsIM for <notmuch@notmuchmail.org>;\r
+ Sat, 18 Jul 2015 08:53:57 -0700 (PDT)\r
+Received: from mail-vn0-f43.google.com (mail-vn0-f43.google.com\r
+ [209.85.216.43])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 7EED66DE0352\r
+ for <notmuch@notmuchmail.org>; Sat, 18 Jul 2015 08:53:57 -0700 (PDT)\r
+Received: by vnk197 with SMTP id 197so10364838vnk.3\r
+ for <notmuch@notmuchmail.org>; Sat, 18 Jul 2015 08:53:54 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:mime-version:in-reply-to:references:date\r
+ :message-id:subject:from:to:content-type;\r
+ bh=kkO+oSQPhiCOkwk/oKrx8xeq7CB3EOi20xydhAB0/k8=;\r
+ b=N/+uJ9Odrf4CwmNTsUC6iVVfRfa6lksTtJXfiRuoXpAVYGAVRqZdKSnxwFQBh2Kh+J\r
+ 52KGRvVIWahy8RSG19aQ7CCyObB4sx/OS5CgV52BmWzfidYGz/yMfC49GniiC4c0sf72\r
+ x1IYKgB7qpbUf9rqqjbUTYBdF6w+/oigNersyl7FDX/27jZEoJztbXedTZ58hn202CAU\r
+ nZ8yfTdGxCMINsxgF1zuPgDMYCwrTwMdvobYoum9ztysHJEo8Nr1qyfQhOqgq9XM0Jt0\r
+ mMHJP0Wt2UqprpYClHBBOGaduY9ROC2cVdipI2DaRzHLw5IpVjKlI4AHXMlxZODpolPP\r
+ RXEg==\r
+X-Gm-Message-State:\r
+ ALoCoQltaEEkH4hCZ52iBWTEWieHWzimUlOU1OOOHxhlNDMpK694lEzJRaiKjtp3aEIBiYKooCkJ\r
+MIME-Version: 1.0\r
+X-Received: by 10.52.14.7 with SMTP id l7mr24242015vdc.82.1437234833814; Sat,\r
+ 18 Jul 2015 08:53:53 -0700 (PDT)\r
+Received: by 10.31.188.202 with HTTP; Sat, 18 Jul 2015 08:53:53 -0700 (PDT)\r
+Received: by 10.31.188.202 with HTTP; Sat, 18 Jul 2015 08:53:53 -0700 (PDT)\r
+In-Reply-To: <20150718153239.GB4527@chitra.no-ip.org>\r
+References: <20150717121111.GF25651@chitra.no-ip.org>\r
+ <55A923E9.5070509@imca-cat.org>\r
+ <20150718091139.GB8311@chitra.no-ip.org>\r
+ <CAJhTkNhQtWbt2-ZudUz4bxC98HOC9W-moUohUDaiDuULNXqb9g@mail.gmail.com>\r
+ <20150718153239.GB4527@chitra.no-ip.org>\r
+Date: Sat, 18 Jul 2015 18:53:53 +0300\r
+Message-ID:\r
+ <CAB+hUn8TuvpCgoW_O2ajrPPT7q8u1cbt7HBok9Rn=V91ZFDa4w@mail.gmail.com>\r
+Subject: Re: Searching for phrases in the body of an email\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Content-Type: multipart/alternative; boundary=20cf30334c17ba90e4051b284f1e\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 18 Jul 2015 15:54:00 -0000\r
+\r
+--20cf30334c17ba90e4051b284f1e\r
+Content-Type: text/plain; charset=UTF-8\r
+\r
+On Jul 18, 2015 6:32 PM, "Suvayu Ali" <fatkasuvayu+linux@gmail.com> wrote:\r
+>\r
+> Hi Xu,\r
+>\r
+> On Sat, Jul 18, 2015 at 10:54:30AM -0400, Xu Wang wrote:\r
+> >\r
+> > First note that I believe notmuch search is case insensitive by\r
+> > default, so your grep should be case insensitive as well.\r
+>\r
+> Good point, I tried that, didn't change the numbers much.  The number of\r
+> matches from grep went up to 24, whereas notmuch count says 463.\r
+>\r
+> > More importantly, I'm not sure how 'no NEAR "plain text" ' syntax is\r
+> > parsed. Maybe it is parsed as {no NEAR plain} or {text}.\r
+> >\r
+>\r
+> Exactly, that's what I do not understand.\r
+>\r
+\r
+export NOTMUCH_DEBUG_QUERY=1\r
+\r
+might help.\r
+\r
+> > You would like to search for the exact phrase, correct? How about the\r
+> > following?\r
+> >\r
+> > notmuch search no adj plain adj text\r
+>\r
+> Good suggestion.  I tried it, and gives me very consistent numbers:\r
+>\r
+> $ notmuch count -- no ADJ plain ADJ text\r
+> 20\r
+> $ notmuch show -- $(notmuch search --output=messages -- no NEAR \"plain\\r
+text\") | \\r
+>       grep -c -iE 'plain[[:space:]/]+text'\r
+> 24\r
+>\r
+> Of course this does not help me solve my original goal, but I guess now\r
+> I can try different queries based on your idea.\r
+>\r
+> Thanks a lot!\r
+>\r
+> --\r
+> Suvayu\r
+>\r
+> Open source is the future. It sets us free.\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+--20cf30334c17ba90e4051b284f1e\r
+Content-Type: text/html; charset=UTF-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+<p dir=3D"ltr"><br>\r
+On Jul 18, 2015 6:32 PM, &quot;Suvayu Ali&quot; &lt;<a href=3D"mailto:fatka=\r
+suvayu%2Blinux@gmail.com">fatkasuvayu+linux@gmail.com</a>&gt; wrote:<br>\r
+&gt;<br>\r
+&gt; Hi Xu,<br>\r
+&gt;<br>\r
+&gt; On Sat, Jul 18, 2015 at 10:54:30AM -0400, Xu Wang wrote:<br>\r
+&gt; &gt;<br>\r
+&gt; &gt; First note that I believe notmuch search is case insensitive by<b=\r
+r>\r
+&gt; &gt; default, so your grep should be case insensitive as well.<br>\r
+&gt;<br>\r
+&gt; Good point, I tried that, didn&#39;t change the numbers much.=C2=A0 Th=\r
+e number of<br>\r
+&gt; matches from grep went up to 24, whereas notmuch count says 463.<br>\r
+&gt;<br>\r
+&gt; &gt; More importantly, I&#39;m not sure how &#39;no NEAR &quot;plain t=\r
+ext&quot; &#39; syntax is<br>\r
+&gt; &gt; parsed. Maybe it is parsed as {no NEAR plain} or {text}.<br>\r
+&gt; &gt;<br>\r
+&gt;<br>\r
+&gt; Exactly, that&#39;s what I do not understand.<br>\r
+&gt;</p>\r
+<p dir=3D"ltr">export NOTMUCH_DEBUG_QUERY=3D1=C2=A0</p>\r
+<p dir=3D"ltr">might help.<br></p>\r
+<p dir=3D"ltr">&gt; &gt; You would like to search for the exact phrase, cor=\r
+rect? How about the<br>\r
+&gt; &gt; following?<br>\r
+&gt; &gt;<br>\r
+&gt; &gt; notmuch search no adj plain adj text<br>\r
+&gt;<br>\r
+&gt; Good suggestion.=C2=A0 I tried it, and gives me very consistent number=\r
+s:<br>\r
+&gt;<br>\r
+&gt; $ notmuch count -- no ADJ plain ADJ text<br>\r
+&gt; 20<br>\r
+&gt; $ notmuch show -- $(notmuch search --output=3Dmessages -- no NEAR \&qu=\r
+ot;plain\ text\&quot;) | \<br>\r
+&gt; =C2=A0 =C2=A0 =C2=A0 grep -c -iE &#39;plain[[:space:]/]+text&#39;<br>\r
+&gt; 24<br>\r
+&gt;<br>\r
+&gt; Of course this does not help me solve my original goal, but I guess no=\r
+w<br>\r
+&gt; I can try different queries based on your idea.<br>\r
+&gt;<br>\r
+&gt; Thanks a lot!<br>\r
+&gt;<br>\r
+&gt; --<br>\r
+&gt; Suvayu<br>\r
+&gt;<br>\r
+&gt; Open source is the future. It sets us free.<br>\r
+&gt; _______________________________________________<br>\r
+&gt; notmuch mailing list<br>\r
+&gt; <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a>=\r
+<br>\r
+&gt; <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch">http://not=\r
+muchmail.org/mailman/listinfo/notmuch</a><br>\r
+</p>\r
+\r
+--20cf30334c17ba90e4051b284f1e--\r