searching for multiple tags

classic Classic list List threaded Threaded
6 messages Options
Brian May-2 Brian May-2
Reply | Threaded
Open this post in threaded view
|

searching for multiple tags

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 <[hidden email]>
https://linuxpenguins.xyz/brian/
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: searching for multiple tags

Brian May <[hidden email]> 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
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Brian May-2 Brian May-2
Reply | Threaded
Open this post in threaded view
|

Re: searching for multiple tags

David Bremner <[hidden email]> 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 <[hidden email]>
https://linuxpenguins.xyz/brian/
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: searching for multiple tags

Brian May <[hidden email]> writes:

> David Bremner <[hidden email]> 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@...
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Brian May-2 Brian May-2
Reply | Threaded
Open this post in threaded view
|

Re: searching for multiple tags

David Bremner <[hidden email]> 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 <[hidden email]>
https://linuxpenguins.xyz/brian/
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: searching for multiple tags

Brian May <[hidden email]> writes:

> David Bremner <[hidden email]> 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
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch