unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Carl Worth <cworth@cworth.org>
To: Gregor Zattler <telegraph@gmx.net>, notmuch@notmuchmail.org
Subject: Re: how to search for hyphenated words? (was: how to search for Morse code?)
Date: Fri, 08 Mar 2019 16:03:02 -0800	[thread overview]
Message-ID: <87a7i4c3t5.fsf@wondoo.home.cworth.org> (raw)
In-Reply-To: <87ef7hyxqs.fsf@len.workgroup>

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

Hi Gregor,

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.

So your messages are not being indexed in a way to let you distinguish
between "org notmuch" and "org-notmuch".

(Of note, the query parser applies the same parsing to your query---so
that even when you think you're typing an exact phrase like
"org-notmuch" that gets parsed into separate terms "org" and "notmuch"
for searching.)

> all these resulted in very many hits most or all of which do not
> contain the string "org-notmuch", one found email was e.g.
>
> id:20180904105723.15564-3-david@tethera.net

That message does contain the following:

   +test_emacs '(notmuch-tree "id:000-real-root@example.org")
   +           (notmuch-test-wait)

Where you will notice that there's a term "org" followed (after some
punctuation and whitespace separators) by a term "notmuch".

> How would one search for hyphenated words with notmuch?

You would need to arrange to have the indexer consider the hyphen as a
letter-like character to be made part of terms. Or be extra clever and
index something like "notmuch-test-wait" in multiple ways (such as a
single term "notmuch-test-wait" as well as three adjacent terms
"notmuch", "test", and "wait" as notmuch is doing currently).

-Carl

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2019-03-09  0:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 12:20 how to search for Morse code? Gregor Zattler
2018-07-23 14:16 ` Ben Oliver
2018-07-24 10:34   ` Ben Oliver
2019-03-08 19:25 ` how to search for hyphenated words? (was: how to search for Morse code?) Gregor Zattler
2019-03-09  0:03   ` Carl Worth [this message]
2019-03-12  0:05     ` Matt Armstrong
2019-03-12  1:13       ` David Bremner
2019-03-12  7:34         ` Gregor Zattler
2019-03-12 10:41           ` David Bremner
2019-03-12 17:29             ` Gregor Zattler
2019-03-12 17:12           ` Carl Worth
2019-03-13 18:23         ` Matt Armstrong
2019-03-10 23:22   ` David Bremner
2019-03-11  8:15     ` Gregor Zattler
     [not found]     ` <877ed5bzr3.fsf@len.workgroup>
2019-03-11  9:46       ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7i4c3t5.fsf@wondoo.home.cworth.org \
    --to=cworth@cworth.org \
    --cc=notmuch@notmuchmail.org \
    --cc=telegraph@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).