Searching for phrases in the body of an email
Suvayu Ali
fatkasuvayu+linux at gmail.com
Sat Jul 18 08:32:39 PDT 2015
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.
More information about the notmuch
mailing list