Inconsistent query results

Jani Nikula jani at nikula.org
Sun Jan 5 07:41:34 PST 2020


On Sun, 05 Jan 2020, Nicolas Bock <nicolasbock at gmail.com> wrote:
> When I run the following query I get no results:
>
>     $ notmuch search --output=files folder:"mail_account/Deleted
> Items" and not tag:deleted
>
> When I run that same query in emacs/notmuch I find one file:
>
>     query: folder:"mail_account/Deleted Items" and not tag:deleted
>     file: /home/nbock/Mail/mail_account/Deleted
> Items/cur/5d5aca30-2ef6-11ea-9e47-28f10e4fd9ec,U=984:2,S
>
> Am I missing something?

Yes, quotes. ;)

Emacs does the quoting for you, but in shell you need to ensure the
double quotes go all the way to Xapian. Try wrapping the folder search
in single quotes: 'folder:"mail_account/Deleted Items"'.

You can use the NOTMUCH_DEBUG_QUERY=1 environment variable to debug
queries. You can see the difference.

BR,
Jani.


More information about the notmuch mailing list