From f85d367e4ee5220ebc2301bc2b35f6a4ded1bff0 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sat, 18 Jul 2015 18:53:53 +0300 Subject: [PATCH] Re: Searching for phrases in the body of an email --- 62/0ff230f75c6aa73f32df997b866660070629f4 | 187 ++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 62/0ff230f75c6aa73f32df997b866660070629f4 diff --git a/62/0ff230f75c6aa73f32df997b866660070629f4 b/62/0ff230f75c6aa73f32df997b866660070629f4 new file mode 100644 index 000000000..2d481a0ad --- /dev/null +++ b/62/0ff230f75c6aa73f32df997b866660070629f4 @@ -0,0 +1,187 @@ +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 4FDC26DE0AF8 + for ; Sat, 18 Jul 2015 08:54:00 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.603 +X-Spam-Level: +X-Spam-Status: No, score=0.603 tagged_above=-999 required=5 tests=[AWL=1.322, + HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H3=-0.01, + RCVD_IN_MSPIKE_WL=-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 UGueViAVPsIM for ; + Sat, 18 Jul 2015 08:53:57 -0700 (PDT) +Received: from mail-vn0-f43.google.com (mail-vn0-f43.google.com + [209.85.216.43]) + by arlo.cworth.org (Postfix) with ESMTPS id 7EED66DE0352 + for ; Sat, 18 Jul 2015 08:53:57 -0700 (PDT) +Received: by vnk197 with SMTP id 197so10364838vnk.3 + for ; Sat, 18 Jul 2015 08:53:54 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:mime-version:in-reply-to:references:date + :message-id:subject:from:to:content-type; + bh=kkO+oSQPhiCOkwk/oKrx8xeq7CB3EOi20xydhAB0/k8=; + b=N/+uJ9Odrf4CwmNTsUC6iVVfRfa6lksTtJXfiRuoXpAVYGAVRqZdKSnxwFQBh2Kh+J + 52KGRvVIWahy8RSG19aQ7CCyObB4sx/OS5CgV52BmWzfidYGz/yMfC49GniiC4c0sf72 + x1IYKgB7qpbUf9rqqjbUTYBdF6w+/oigNersyl7FDX/27jZEoJztbXedTZ58hn202CAU + nZ8yfTdGxCMINsxgF1zuPgDMYCwrTwMdvobYoum9ztysHJEo8Nr1qyfQhOqgq9XM0Jt0 + mMHJP0Wt2UqprpYClHBBOGaduY9ROC2cVdipI2DaRzHLw5IpVjKlI4AHXMlxZODpolPP + RXEg== +X-Gm-Message-State: + ALoCoQltaEEkH4hCZ52iBWTEWieHWzimUlOU1OOOHxhlNDMpK694lEzJRaiKjtp3aEIBiYKooCkJ +MIME-Version: 1.0 +X-Received: by 10.52.14.7 with SMTP id l7mr24242015vdc.82.1437234833814; Sat, + 18 Jul 2015 08:53:53 -0700 (PDT) +Received: by 10.31.188.202 with HTTP; Sat, 18 Jul 2015 08:53:53 -0700 (PDT) +Received: by 10.31.188.202 with HTTP; Sat, 18 Jul 2015 08:53:53 -0700 (PDT) +In-Reply-To: <20150718153239.GB4527@chitra.no-ip.org> +References: <20150717121111.GF25651@chitra.no-ip.org> + <55A923E9.5070509@imca-cat.org> + <20150718091139.GB8311@chitra.no-ip.org> + + <20150718153239.GB4527@chitra.no-ip.org> +Date: Sat, 18 Jul 2015 18:53:53 +0300 +Message-ID: + +Subject: Re: Searching for phrases in the body of an email +From: Jani Nikula +To: Notmuch Mail +Content-Type: multipart/alternative; boundary=20cf30334c17ba90e4051b284f1e +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:54:00 -0000 + +--20cf30334c17ba90e4051b284f1e +Content-Type: text/plain; charset=UTF-8 + +On Jul 18, 2015 6:32 PM, "Suvayu Ali" wrote: +> +> 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. +> + +export NOTMUCH_DEBUG_QUERY=1 + +might help. + +> > 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. +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch + +--20cf30334c17ba90e4051b284f1e +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + +


+On Jul 18, 2015 6:32 PM, "Suvayu Ali" <fatkasuvayu+linux@gmail.com> wrote:
+>
+> 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.=C2=A0 Th= +e number of
+> matches from grep went up to 24, whereas notmuch count says 463.
+>
+> > More importantly, I'm not sure how 'no NEAR "plain t= +ext" ' syntax is
+> > parsed. Maybe it is parsed as {no NEAR plain} or {text}.
+> >
+>
+> Exactly, that's what I do not understand.
+>

+

export NOTMUCH_DEBUG_QUERY=3D1=C2=A0

+

might help.

+

> > You would like to search for the exact phrase, cor= +rect? How about the
+> > following?
+> >
+> > notmuch search no adj plain adj text
+>
+> Good suggestion.=C2=A0 I tried it, and gives me very consistent number= +s:
+>
+> $ notmuch count -- no ADJ plain ADJ text
+> 20
+> $ notmuch show -- $(notmuch search --output=3Dmessages -- no NEAR \&qu= +ot;plain\ text\") | \
+> =C2=A0 =C2=A0 =C2=A0 grep -c -iE 'plain[[:space:]/]+text'
+> 24
+>
+> Of course this does not help me solve my original goal, but I guess no= +w
+> I can try different queries based on your idea.
+>
+> Thanks a lot!
+>
+> --
+> Suvayu
+>
+> Open source is the future. It sets us free.
+> _______________________________________________
+> notmuch mailing list
+> notmuch@notmuchmail.org= +
+> http://not= +muchmail.org/mailman/listinfo/notmuch
+

+ +--20cf30334c17ba90e4051b284f1e-- -- 2.26.2