* Searching with prefix :folder and --output=files
@ 2013-06-11 21:34 Nathan Clapham
2013-06-12 8:48 ` Mark Walters
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Clapham @ 2013-06-11 21:34 UTC (permalink / raw)
To: notmuch
Hi Everyone,
Thanks for notmuch mail, it is a great program!
I am having an issue searching with --output=files and the folder prefix.
Could you please tell me if I've misunderstood something or perhaps there is
something wrong with my setup. Details of 2 examples below:
$ notmuch --version
notmuch 0.15.2
----
1. Archive folder
Archive message #: 1356
Directory: $HOME/Mail/Gmail/[Gmail].Archive
$ notmuch count folder:Archive
1356
$ notmuch search --output=messages folder:Archive | wc -l
1356
$ notmuch search --output=files folder:Archive | wc -l
1572
I wondered why I was getting more files listed in the last example. It turns out
some files are included from other folders. For example:
Mail/Gmail/[Gmail].Sent Mail/cur/137075610...28e65ad90fc4f:2,S
If I then do this:
$ notmuch search --output=files folder:Archive | grep Archive | wc -l
1356
I get the correct count again.
Different folders have a similar issue:
2. INBOX folder
INBOX message #: 87
Directory: $HOME/Mail/Gmail/INBOX
$ notmuch count folder:INBOX
87
$ notmuch search --output=messages folder:INBOX | wc -l
87
$ notmuch search --output=files folder:INBOX | wc -l
97
This time some messages from Archive are included:
Mail/Gmail/[Gmail].Archive/cur/137077654...d7c877e152f72dd5ddbc11f:2,S
$ notmuch search --output=files folder:INBOX | grep INBOX | wc -l
87
----
I think this illustrates the problem I'm having. Maybe I don't understand how
the folder: prefix works? Perhaps it is my folder structure - the inclusion of
the imap prefix [Gmail].?? It seems the search is matching the correct messages
though, but the output of files includes messages from another folder.
Any advice would be appreciated.
Thanks,
Nathan.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Searching with prefix :folder and --output=files
2013-06-11 21:34 Searching with prefix :folder and --output=files Nathan Clapham
@ 2013-06-12 8:48 ` Mark Walters
2013-06-12 11:32 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Mark Walters @ 2013-06-12 8:48 UTC (permalink / raw)
To: Nathan Clapham, notmuch
Hello
This is the "expected" but, I agree, counter-intuitive result.
First notmuch finds all the *messages* that match your query (ie
which have an associated filename matching the folder: part of your
query) and then it returns all filenames for these messages.
I think that notmuch views a message (as determined by a message-id) as
a single object in its database (it assumes that all copies are
identical) so fixing this would not be easy.
Best wishes
Mark
Nathan Clapham <nathan@claphams.info> writes:
> Hi Everyone,
>
> Thanks for notmuch mail, it is a great program!
>
> I am having an issue searching with --output=files and the folder prefix.
>
> Could you please tell me if I've misunderstood something or perhaps there is
> something wrong with my setup. Details of 2 examples below:
>
> $ notmuch --version
> notmuch 0.15.2
>
> ----
> 1. Archive folder
>
> Archive message #: 1356
> Directory: $HOME/Mail/Gmail/[Gmail].Archive
>
> $ notmuch count folder:Archive
> 1356
>
> $ notmuch search --output=messages folder:Archive | wc -l
> 1356
>
> $ notmuch search --output=files folder:Archive | wc -l
> 1572
>
> I wondered why I was getting more files listed in the last example. It turns out
> some files are included from other folders. For example:
>
> Mail/Gmail/[Gmail].Sent Mail/cur/137075610...28e65ad90fc4f:2,S
>
> If I then do this:
>
> $ notmuch search --output=files folder:Archive | grep Archive | wc -l
> 1356
>
> I get the correct count again.
>
> Different folders have a similar issue:
>
> 2. INBOX folder
>
> INBOX message #: 87
> Directory: $HOME/Mail/Gmail/INBOX
>
> $ notmuch count folder:INBOX
> 87
>
> $ notmuch search --output=messages folder:INBOX | wc -l
> 87
>
> $ notmuch search --output=files folder:INBOX | wc -l
> 97
>
> This time some messages from Archive are included:
>
> Mail/Gmail/[Gmail].Archive/cur/137077654...d7c877e152f72dd5ddbc11f:2,S
>
> $ notmuch search --output=files folder:INBOX | grep INBOX | wc -l
> 87
> ----
>
> I think this illustrates the problem I'm having. Maybe I don't understand how
> the folder: prefix works? Perhaps it is my folder structure - the inclusion of
> the imap prefix [Gmail].?? It seems the search is matching the correct messages
> though, but the output of files includes messages from another folder.
>
> Any advice would be appreciated.
>
> Thanks,
> Nathan.
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Searching with prefix :folder and --output=files
2013-06-12 8:48 ` Mark Walters
@ 2013-06-12 11:32 ` Jani Nikula
0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2013-06-12 11:32 UTC (permalink / raw)
To: Mark Walters, Nathan Clapham, notmuch
On Wed, 12 Jun 2013, Mark Walters <markwalters1009@gmail.com> wrote:
> First notmuch finds all the *messages* that match your query (ie
> which have an associated filename matching the folder: part of your
> query) and then it returns all filenames for these messages.
I recently sent patches to clarify the man pages a bit while adding a
new feature to the cli:
http://mid.gmane.org/1370881897-3386-1-git-send-email-jani@nikula.org
http://mid.gmane.org/1370881714-3303-1-git-send-email-jani@nikula.org
> I think that notmuch views a message (as determined by a message-id) as
> a single object in its database (it assumes that all copies are
> identical) so fixing this would not be easy.
Assuming any fixing is needed, that is. One would assume any notmuch
search --output=files *without* the folder: prefix would return all
files for all matching messages. I think it would be rather confusing if
the folder: prefix modified that.
Like Mark said, the most important thing to understand is that all
notmuch searches match messages. The --output option just modifies how
those matching messages are presented; it does not affect what is
searched for at all.
BR,
Jani.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-12 11:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-11 21:34 Searching with prefix :folder and --output=files Nathan Clapham
2013-06-12 8:48 ` Mark Walters
2013-06-12 11:32 ` Jani Nikula
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).