how to search for hyphenated words? (was: how to search for Morse code?)

Gregor Zattler telegraph at
Tue Mar 12 00:34:19 PDT 2019

Hi David, Matt, Carl, notmuch developers,
* David Bremner <david at> [2019-03-11; 22:13]:
> Matt Armstrong <marmstrong at> writes:
>> Carl Worth <cworth at> writes:
>>> The trick here is that when notmuch is indexing body text it feeds it
>>> into a Xapian function that parses the text by finding "terms" in the
>>> text. And this parser considers both punctuation and whitespace as
>>> separators between terms.
>> I notice that Xapian supports something called "phrase searches",
>> documented as:
>>   "A phrase surrounded with double quotes ("") matches documents
>>   containing that exact phrase. Hyphenated words are also treated as
>>   phrases, as are cases such as filenames and email addresses
>>   (e.g. /etc/passwd or president at"
>> I assume that this particular Xapian feature is unavailable in notmuch?
>> If so, I wonder if enabling has ever been considered?
> It is enabled, and documented in notmuch-search-terms(7). Unfortunately
> I don't think it's related to the original request. The mention of
> hyphenated words is about the input to the query parser, not the
> (necessarily) the retrieved text.

what I do not understand is that it dosn't matter if I search for





or even

org ADJ/1 notmuch

$ notmuch count --output=messages '"org-notmuch"'
$ notmuch count --output=messages 'org-notmuch'
$ notmuch count --output=messages org-notmuch
$ notmuch count --output=messages org ADJ/1 notmuch

a typical example of a matched message is the attached one.
Somehow the search matches the address of this very mailing list
in the body of the email (I assume).

But obviously there are much more emails with this address in

$ notmuch count --output=messages 'notmuch at'
$ notmuch count --output=messages '"notmuch at"'

Or with a naive search (no decoding of possible base64 encoded
parts) there are

$ find /home/grfz/Mail/~ml/emacs-orgmode at /home/grfz/Mail/~ml/notmuch at* -type f -print0 | xargs -0r grep -l -- 'notmuch at' | xargs -IXXXX sh -c "cat XXXX | sed -e '1,/^$/ d' | grep -c notmuch at " | egrep -c "1|2|3|4|5|6|7|8|9"

emails with the address at least once in the body.

Therefore I wonder why notmuch matches 581 messages.

A naive search for org-notmuch on the files (no decoding of
possible base64 encoded parts) only shows 79 files (77 unique

mkdir -vp /tmp/test/{cur,new,tmp}

$ find /home/grfz/Mail/~ml/emacs-orgmode at /home/grfz/Mail/~ml/notmuch at* -type f -print0 | xargs -0r grep -l -- 'org-notmuch' | xargs ln -vs --target-directory=/tmp/kolp/cur/ | wc -l

Therefore I wonder why notmuch matches 581 messages, not 16795
messages or 77 messages.

Somehow these numbers do not fit!?

Ciao; Gregor
 -... --- .-. . -.. ..--.. ...-.-
-------------- next part --------------
An embedded message was scrubbed...
From: root at len.workgroup (Cron Daemon)
Subject: Cron <grfz at len> ~/bin/mailwiederdurchschleusen
Date: Fri, 29 Dec 2017 17:00:09 +0100
Size: 1571
URL: <>

More information about the notmuch mailing list