unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* searching for multiple tags
@ 2018-03-17  5:13 Brian May
  2018-03-17 11:08 ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: Brian May @ 2018-03-17  5:13 UTC (permalink / raw)
  To: notmuch

Hello,

How do I search for emails containing multiple tags?

I have tried:

tag:unread tag:important

However, this finds emails that contain either the unread tag or the
important tag. Not emails that contain both.

Am I doing something wrong?

This is version 0.23.7-3 in Debian/stretch.

Thanks
-- 
Brian May <brian@linuxpenguins.xyz>
https://linuxpenguins.xyz/brian/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: searching for multiple tags
  2018-03-17  5:13 searching for multiple tags Brian May
@ 2018-03-17 11:08 ` David Bremner
  2018-03-17 21:44   ` Brian May
  0 siblings, 1 reply; 6+ messages in thread
From: David Bremner @ 2018-03-17 11:08 UTC (permalink / raw)
  To: Brian May, notmuch

Brian May <brian@linuxpenguins.xyz> writes:

> Hello,
>
> How do I search for emails containing multiple tags?
>
> I have tried:
>
> tag:unread tag:important
>
> However, this finds emails that contain either the unread tag or the
> important tag. Not emails that contain both.
>
> Am I doing something wrong?

This is a design-choice/quirk of the Xapian query parser, discussed
under "Operators" in man notmuch-search-terms; terms with a common
prefix are implicitely combined with an OR.
I don't think that documentation has changed since 0.23, but you can
compare with https://notmuchmail.org/manpages/notmuch-search-terms-7/

d

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: searching for multiple tags
  2018-03-17 11:08 ` David Bremner
@ 2018-03-17 21:44   ` Brian May
  2018-03-17 23:06     ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: Brian May @ 2018-03-17 21:44 UTC (permalink / raw)
  To: David Bremner, notmuch

David Bremner <david@tethera.net> writes:

> This is a design-choice/quirk of the Xapian query parser, discussed
> under "Operators" in man notmuch-search-terms; terms with a common
> prefix are implicitely combined with an OR.
> I don't think that documentation has changed since 0.23, but you can
> compare with https://notmuchmail.org/manpages/notmuch-search-terms-7/

Ok, now I understand that text. Thanks. I tried using "tag:important and
tag:unread" yesterday, and it didn't work either.

Today I am wondering if maybe I had threads that had some messages
marked important and some marked unread, but no individual messages
marked both unread and important. Oh well, maybe this was the real
reason I was having problems.

Thanks for your response.
-- 
Brian May <brian@linuxpenguins.xyz>
https://linuxpenguins.xyz/brian/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: searching for multiple tags
  2018-03-17 21:44   ` Brian May
@ 2018-03-17 23:06     ` David Bremner
  2018-03-18  0:56       ` Brian May
  0 siblings, 1 reply; 6+ messages in thread
From: David Bremner @ 2018-03-17 23:06 UTC (permalink / raw)
  To: Brian May, notmuch

Brian May <brian@linuxpenguins.xyz> writes:

> David Bremner <david@tethera.net> writes:
>
>> This is a design-choice/quirk of the Xapian query parser, discussed
>> under "Operators" in man notmuch-search-terms; terms with a common
>> prefix are implicitely combined with an OR.
>> I don't think that documentation has changed since 0.23, but you can
>> compare with https://notmuchmail.org/manpages/notmuch-search-terms-7/
>
> Ok, now I understand that text. Thanks. I tried using "tag:important and
> tag:unread" yesterday, and it didn't work either.
>
> Today I am wondering if maybe I had threads that had some messages
> marked important and some marked unread, but no individual messages
> marked both unread and important. Oh well, maybe this was the real
> reason I was having problems.

You can test that theory with

% notmuch search --output=messages tag:important and tag:unread

There is a patch floating around [1] to support

% notmuch search thread:{tag:important} and thread:{tag:unread}

if that's the query you actually want.


[1] http://mid.mail-archive.com/20171226010305.26579-1-david@tethera.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: searching for multiple tags
  2018-03-17 23:06     ` David Bremner
@ 2018-03-18  0:56       ` Brian May
  2018-03-18  1:44         ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: Brian May @ 2018-03-18  0:56 UTC (permalink / raw)
  To: David Bremner, notmuch

David Bremner <david@tethera.net> writes:

> There is a patch floating around [1] to support
>
> % notmuch search thread:{tag:important} and thread:{tag:unread}
>
> if that's the query you actually want.

I assume this means we search for threads where at least one message is
important and at least one message is unread.

That actually sounds like a very useful feature to have. I would most
definitely have uses for it. Is there any chance of this (or something
like it) being merged into notmuch?

Thanks
-- 
Brian May <brian@linuxpenguins.xyz>
https://linuxpenguins.xyz/brian/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: searching for multiple tags
  2018-03-18  0:56       ` Brian May
@ 2018-03-18  1:44         ` David Bremner
  0 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2018-03-18  1:44 UTC (permalink / raw)
  To: Brian May, notmuch

Brian May <brian@linuxpenguins.xyz> writes:

> David Bremner <david@tethera.net> writes:
>
>> There is a patch floating around [1] to support
>>
>> % notmuch search thread:{tag:important} and thread:{tag:unread}
>>
>> if that's the query you actually want.
>
> I assume this means we search for threads where at least one message is
> important and at least one message is unread.
>
> That actually sounds like a very useful feature to have. I would most
> definitely have uses for it. Is there any chance of this (or something
> like it) being merged into notmuch?

There's certainly some chance. At the moment I'm waiting for more
feedback from people on performance; it works in a kind of brute force
way.

d

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-18  1:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-17  5:13 searching for multiple tags Brian May
2018-03-17 11:08 ` David Bremner
2018-03-17 21:44   ` Brian May
2018-03-17 23:06     ` David Bremner
2018-03-18  0:56       ` Brian May
2018-03-18  1:44         ` David Bremner

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).