Apparently, terms with a common prefix are *not* connected by implicit "OR"

Jorge P. de Morais Neto jorge+list at disroot.org
Thu Aug 15 07:58:34 PDT 2019


[ I had replied to David Bremner alone so I didn't have to worry about
private information leakage.  But now I decided to clean the private
information and reply to the list too. ]

Em 2019-08-11T20:08:58-0300, David Bremner escreveu:
> Thanks for the report. As a test, can you try with
>
>      $ notmuch count '(to:pontodosconcursos.com.br to:"jorge+cp+concurso at disroot.org")'
>
> I suspect that will work around the problem, which I believe is related
> to the way that notmuch uses the xapian parser (in order to provide
> regexp matching for some prefixes). In particular, if I try that with
> NOTMUCH_DEBUG_QUERY=yes in the environment I can see the implicit OR.
>
> d
Thank you for the instructions, but they did not work.  Below are
several results from ~notmuch count~.

--8<---------------cut here---------------start------------->8---
$ notmuch count '(to:pontodosconcursos.com.br OR to:jorge+cp+concurso at disroot.org)'
70
$ notmuch count '(to:pontodosconcursos.com.br)'
0
$ notmuch count 'to:pontodosconcursos.com.br'
0
$ notmuch count 'to:jorge+cp+concurso at disroot.org'
70
$ NOTMUCH_DEBUG_QUERY=yes notmuch count '(to:pontodosconcursos.com.br OR to:jorge+cp+concurso at disroot.org)'
Query string is:
(to:pontodosconcursos.com.br OR to:jorge+cp+concurso at disroot.org)
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((XTOpontodosconcursos at 1 PHRASE 3 XTOcom at 2 PHRASE 3 XTObr at 3) OR (ZXTOjorg at 4 AND (Zcp at 5 OR ZGcp at 5 OR ZKcp at 5 OR ZKcp at 5 OR ZQcp at 5 OR ZQcp at 5 OR ZPcp at 5 OR ZXPROPERTYcp at 5 OR
ZXFOLDER:cp at 5 OR ZXFROMcp at 5 OR ZXTOcp at 5 OR ZXATTACHMENTcp at 5 OR ZXMIMETYPEcp at 5 OR ZXSUBJECTcp at 5) AND ((concurso at 6 PHRASE 3 disroot at 7 PHRASE 3 org at 8) OR (Gconcurso at 6 PHRASE 3 Gdisroot at 7
PHRASE 3 Gorg at 8) OR (Kconcurso at 6 PHRASE 3 Kdisroot at 7 PHRASE 3 Korg at 8) OR (Kconcurso at 6 PHRASE 3 Kdisroot at 7 PHRASE 3 Korg at 8) OR (Qconcurso at 6 PHRASE 3 Qdisroot at 7 PHRASE 3 Qorg at 8) OR
(Qconcurso at 6 PHRASE 3 Qdisroot at 7 PHRASE 3 Qorg at 8) OR (Pconcurso at 6 PHRASE 3 Pdisroot at 7 PHRASE 3 Porg at 8) OR (XPROPERTYconcurso at 6 PHRASE 3 XPROPERTYdisroot at 7 PHRASE 3 XPROPERTYorg at 8) OR
(XFOLDER:concurso at 6 PHRASE 3 XFOLDER:disroot at 7 PHRASE 3 XFOLDER:org at 8) OR (XFROMconcurso at 6 PHRASE 3 XFROMdisroot at 7 PHRASE 3 XFROMorg at 8) OR (XTOconcurso at 6 PHRASE 3 XTOdisroot at 7 PHRASE 3
XTOorg at 8) OR (XATTACHMENTconcurso at 6 PHRASE 3 XATTACHMENTdisroot at 7 PHRASE 3 XATTACHMENTorg at 8) OR (XMIMETYPEconcurso at 6 PHRASE 3 XMIMETYPEdisroot at 7 PHRASE 3 XMIMETYPEorg at 8) OR
(XSUBJECTconcurso at 6 PHRASE 3 XSUBJECTdisroot at 7 PHRASE 3 XSUBJECTorg at 8))))) AND_NOT ((Kdeleted OR Kspam) OR Ktrash)))
70
$ NOTMUCH_DEBUG_QUERY=yes notmuch count '(to:pontodosconcursos.com.br to:jorge+cp+concurso at disroot.org)'
Query string is:
(to:pontodosconcursos.com.br to:jorge+cp+concurso at disroot.org)
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((XTOpontodosconcursos at 1 PHRASE 3 XTOcom at 2 PHRASE 3 XTObr at 3) AND ZXTOjorg at 4 AND (Zcp at 5 OR ZGcp at 5 OR ZKcp at 5 OR ZKcp at 5 OR ZQcp at 5 OR ZQcp at 5 OR ZPcp at 5 OR ZXPROPERTYcp at 5 OR
ZXFOLDER:cp at 5 OR ZXFROMcp at 5 OR ZXTOcp at 5 OR ZXATTACHMENTcp at 5 OR ZXMIMETYPEcp at 5 OR ZXSUBJECTcp at 5) AND ((concurso at 6 PHRASE 3 disroot at 7 PHRASE 3 org at 8) OR (Gconcurso at 6 PHRASE 3 Gdisroot at 7
PHRASE 3 Gorg at 8) OR (Kconcurso at 6 PHRASE 3 Kdisroot at 7 PHRASE 3 Korg at 8) OR (Kconcurso at 6 PHRASE 3 Kdisroot at 7 PHRASE 3 Korg at 8) OR (Qconcurso at 6 PHRASE 3 Qdisroot at 7 PHRASE 3 Qorg at 8) OR
(Qconcurso at 6 PHRASE 3 Qdisroot at 7 PHRASE 3 Qorg at 8) OR (Pconcurso at 6 PHRASE 3 Pdisroot at 7 PHRASE 3 Porg at 8) OR (XPROPERTYconcurso at 6 PHRASE 3 XPROPERTYdisroot at 7 PHRASE 3 XPROPERTYorg at 8) OR
(XFOLDER:concurso at 6 PHRASE 3 XFOLDER:disroot at 7 PHRASE 3 XFOLDER:org at 8) OR (XFROMconcurso at 6 PHRASE 3 XFROMdisroot at 7 PHRASE 3 XFROMorg at 8) OR (XTOconcurso at 6 PHRASE 3 XTOdisroot at 7 PHRASE 3
XTOorg at 8) OR (XATTACHMENTconcurso at 6 PHRASE 3 XATTACHMENTdisroot at 7 PHRASE 3 XATTACHMENTorg at 8) OR (XMIMETYPEconcurso at 6 PHRASE 3 XMIMETYPEdisroot at 7 PHRASE 3 XMIMETYPEorg at 8) OR
(XSUBJECTconcurso at 6 PHRASE 3 XSUBJECTdisroot at 7 PHRASE 3 XSUBJECTorg at 8)))) AND_NOT ((Kdeleted OR Kspam) OR Ktrash)))
0
$ NOTMUCH_DEBUG_QUERY=yes notmuch count '(to:pontodosconcursos.com.br to:"jorge+cp+concurso at disroot.org")'
Query string is:
(to:pontodosconcursos.com.br to:"jorge+cp+concurso at disroot.org")
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((XTOpontodosconcursos at 1 PHRASE 3 XTOcom at 2 PHRASE 3 XTObr at 3) AND (XTOjorge at 4 PHRASE 5 XTOcp at 5 PHRASE 5 XTOconcurso at 6 PHRASE 5 XTOdisroot at 7 PHRASE 5 XTOorg at 8))) AND_NOT
((Kdeleted OR Kspam) OR Ktrash)))
0
$ NOTMUCH_DEBUG_QUERY=yes notmuch count '(to:pontodosconcursos.com.br OR to:"jorge+cp+concurso at disroot.org")'
Query string is:
(to:pontodosconcursos.com.br OR to:"jorge+cp+concurso at disroot.org")
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((XTOpontodosconcursos at 1 PHRASE 3 XTOcom at 2 PHRASE 3 XTObr at 3) OR (XTOjorge at 4 PHRASE 5 XTOcp at 5 PHRASE 5 XTOconcurso at 6 PHRASE 5 XTOdisroot at 7 PHRASE 5 XTOorg at 8))) AND_NOT
((Kdeleted OR Kspam) OR Ktrash)))
69
$ NOTMUCH_DEBUG_QUERY=yes notmuch count '(to:pontodosconcursos.com.br to:"jorge+cp+concurso at disroot.org")'
Query string is:
(to:pontodosconcursos.com.br to:"jorge+cp+concurso at disroot.org")
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((XTOpontodosconcursos at 1 PHRASE 3 XTOcom at 2 PHRASE 3 XTObr at 3) AND (XTOjorge at 4 PHRASE 5 XTOcp at 5 PHRASE 5 XTOconcurso at 6 PHRASE 5 XTOdisroot at 7 PHRASE 5 XTOorg at 8))) AND_NOT
((Kdeleted OR Kspam) OR Ktrash)))
0
$ NOTMUCH_DEBUG_QUERY=yes notmuch count '(to:"pontodosconcursos.com.br" to:"jorge+cp+concurso at disroot.org")'
Query string is:
(to:"pontodosconcursos.com.br" to:"jorge+cp+concurso at disroot.org")
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((XTOpontodosconcursos at 1 PHRASE 3 XTOcom at 2 PHRASE 3 XTObr at 3) AND (XTOjorge at 4 PHRASE 5 XTOcp at 5 PHRASE 5 XTOconcurso at 6 PHRASE 5 XTOdisroot at 7 PHRASE 5 XTOorg at 8))) AND_NOT
((Kdeleted OR Kspam) OR Ktrash)))
0
$ NOTMUCH_DEBUG_QUERY=yes notmuch count 'to:"pontodosconcursos.com.br" to:"jorge+cp+concurso at disroot.org"'
Query string is:
to:"pontodosconcursos.com.br" to:"jorge+cp+concurso at disroot.org"
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((XTOpontodosconcursos at 1 PHRASE 3 XTOcom at 2 PHRASE 3 XTObr at 3) AND (XTOjorge at 4 PHRASE 5 XTOcp at 5 PHRASE 5 XTOconcurso at 6 PHRASE 5 XTOdisroot at 7 PHRASE 5 XTOorg at 8))) AND_NOT
((Kdeleted OR Kspam) OR Ktrash)))
0
$ NOTMUCH_DEBUG_QUERY=yes notmuch count 'to:jorge+cp+concurso at disroot.org XOR to:"jorge+cp+concurso at disroot.org"'
Query string is:
to:jorge+cp+concurso at disroot.org XOR to:"jorge+cp+concurso at disroot.org"
Exclude query is:
Query(((Kdeleted OR Kspam) OR Ktrash))
Final query is:
Query(((Tmail AND ((ZXTOjorg at 1 AND (Zcp at 2 OR ZGcp at 2 OR ZKcp at 2 OR ZKcp at 2 OR ZQcp at 2 OR ZQcp at 2 OR ZPcp at 2 OR ZXPROPERTYcp at 2 OR ZXFOLDER:cp at 2 OR ZXFROMcp at 2 OR ZXTOcp at 2 OR ZXATTACHMENTcp at 2 OR
ZXMIMETYPEcp at 2 OR ZXSUBJECTcp at 2) AND ((concurso at 3 PHRASE 3 disroot at 4 PHRASE 3 org at 5) OR (Gconcurso at 3 PHRASE 3 Gdisroot at 4 PHRASE 3 Gorg at 5) OR (Kconcurso at 3 PHRASE 3 Kdisroot at 4 PHRASE 3
Korg at 5) OR (Kconcurso at 3 PHRASE 3 Kdisroot at 4 PHRASE 3 Korg at 5) OR (Qconcurso at 3 PHRASE 3 Qdisroot at 4 PHRASE 3 Qorg at 5) OR (Qconcurso at 3 PHRASE 3 Qdisroot at 4 PHRASE 3 Qorg at 5) OR (Pconcurso at 3
PHRASE 3 Pdisroot at 4 PHRASE 3 Porg at 5) OR (XPROPERTYconcurso at 3 PHRASE 3 XPROPERTYdisroot at 4 PHRASE 3 XPROPERTYorg at 5) OR (XFOLDER:concurso at 3 PHRASE 3 XFOLDER:disroot at 4 PHRASE 3 XFOLDER:org at 5)
OR (XFROMconcurso at 3 PHRASE 3 XFROMdisroot at 4 PHRASE 3 XFROMorg at 5) OR (XTOconcurso at 3 PHRASE 3 XTOdisroot at 4 PHRASE 3 XTOorg at 5) OR (XATTACHMENTconcurso at 3 PHRASE 3 XATTACHMENTdisroot at 4 PHRASE 3
XATTACHMENTorg at 5) OR (XMIMETYPEconcurso at 3 PHRASE 3 XMIMETYPEdisroot at 4 PHRASE 3 XMIMETYPEorg at 5) OR (XSUBJECTconcurso at 3 PHRASE 3 XSUBJECTdisroot at 4 PHRASE 3 XSUBJECTorg at 5))) XOR (XTOjorge at 6
PHRASE 5 XTOcp at 7 PHRASE 5 XTOconcurso at 8 PHRASE 5 XTOdisroot at 9 PHRASE 5 XTOorg at 10))) AND_NOT ((Kdeleted OR Kspam) OR Ktrash)))
1
--8<---------------cut here---------------end--------------->8---

Below are the contents of ~/home/jorge/.config/notmuch/config~.

--8<---------------cut here---------------start------------->8---
# .notmuch-config - Configuration file for the notmuch mail system
#
# For more information about notmuch, see https://notmuchmail.org

# Database configuration
#
# The only value supported here is 'path' which should be the top-level
# directory where your mail currently exists and to where mail will be
# delivered in the future. Files should be individual email messages.
# Notmuch will store its database within a sub-directory of the path
# configured here named ".notmuch".
#

[database]
path=/home/jorge/offlineimap/Jorge-Disroot

# User configuration
#
# Here is where you can let notmuch know how you would like to be
# addressed. Valid settings are
#
#	name		Your full name.
#	primary_email	Your primary email address.
#	other_email	A list (separated by ';') of other email addresses
#			at which you receive email.
#
# Notmuch will use the various email addresses configured here when
# formatting replies. It will avoid including your own addresses in the
# recipient list of replies, and will set the From address based on the
# address to which the original email was addressed.
#
[user]
name=Jorge P. de Morais Neto
primary_email= < jorge AT_SIGN disroot DOT org>
other_email=<REDACTED;<REDACTED>;<REDACTED>;<REDACTED>;<jorge PLUS-SIGN list AT_SIGN disroot DOT org;<REDACTED>;<REDACTED>;<REDACTED>;<REDACTED>;

# Configuration for "notmuch new"
#
# The following options are supported here:
#
#	tags	A list (separated by ';') of the tags that will be
#		added to all messages incorporated by "notmuch new".
#
#	ignore	A list (separated by ';') of file and directory names
#		that will not be searched for messages by "notmuch new".
#
#		NOTE: *Every* file/directory that goes by one of those
#		names will be ignored, independent of its depth/location
#		in the mail store.
#
[new]
# tags=unread;inbox;new;
# http://afew.readthedocs.io/en/latest/quickstart.html#initial-config
tags=new
ignore=

# Search configuration
#
# The following option is supported here:
#
#	exclude_tags
#		A ;-separated list of tags that will be excluded from
#		search results by default.  Using an excluded tag in a
#		query will override that exclusion.
#
[search]
exclude_tags=deleted;spam;trash;

# Maildir compatibility configuration
#
# The following option is supported here:
#
#	synchronize_flags      Valid values are true and false.
#
#	If true, then the following maildir flags (in message filenames)
#	will be synchronized with the corresponding notmuch tags:
#
#		Flag	Tag
#		----	-------
#		D	draft
#		F	flagged
#		P	passed
#		R	replied
#		S	unread (added when 'S' flag is not present)
#
#	The "notmuch new" command will notice flag changes in filenames
#	and update tags, while the "notmuch tag" and "notmuch restore"
#	commands will notice tag changes and update flags in filenames
#
[maildir]
synchronize_flags=true

# Cryptography related configuration
#
# The following *deprecated* option is currently supported:
#
#	gpg_path
#		binary name or full path to invoke gpg.
#		NOTE: In a future build, this option will be ignored.
#		Setting $PATH is a better approach.
#
[crypto]
gpg_path=gpg
--8<---------------cut here---------------end--------------->8---

 Regards
-- 
- I am Brazilian.  I hope my English is correct and I welcome feedback
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z
- Free/libre software for Android: https://f-droid.org/
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]


More information about the notmuch mailing list