unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch_query_add_tag_exclude bug
@ 2018-03-04 10:26 Justus Winter
  2018-03-11 13:19 ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: Justus Winter @ 2018-03-04 10:26 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 856 bytes --]

Hi :)

so I found a weird bug with notmuch_query_add_tag_exclude.  Apparently,
when I exclude 'spam', and search for 'spam', I still get results, but
if I exclude 'spam', and search for 'is_a_spam', I get no results, even
though there are mails tagged with that tag.

~~~ snip ~~~
import notmuch

d = notmuch.Database()
q = d.create_query("tag:spam")
q.exclude_tag("spam")
assert len(list(q.search_messages())) > 0

q = d.create_query("tag:is_a_spam")
assert len(list(q.search_messages())) > 0

q = d.create_query("tag:is_a_spam")
q.exclude_tag("spam")
assert len(list(q.search_messages())) > 0, "weird"
~~~ snip ~~~

% python3 ignore_tag_bug.py
Traceback (most recent call last):
  File "ignore_tag_bug.py", line 13, in <module>
    assert len(list(q.search_messages())) > 0, "weird"
AssertionError: weird
% notmuch --version
notmuch 0.26

Cheers,
Justus

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: notmuch_query_add_tag_exclude bug
  2018-03-04 10:26 notmuch_query_add_tag_exclude bug Justus Winter
@ 2018-03-11 13:19 ` David Bremner
  2018-03-11 14:55   ` Justus Winter
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2018-03-11 13:19 UTC (permalink / raw)
  To: Justus Winter, notmuch

Justus Winter <justus@sequoia-pgp.org> writes:

> Hi :)
>
> so I found a weird bug with notmuch_query_add_tag_exclude.  Apparently,
> when I exclude 'spam', and search for 'spam', I still get results, but
> if I exclude 'spam', and search for 'is_a_spam', I get no results, even
> though there are mails tagged with that tag.
>

I'm not sure I follow you you. Can you try with

    export NOTMUCH_DEBUG_QUERY=yes

and see what the query terms are?

The latter actually sounds legit assuming

    - the excluded messages are tagged spam
    - the query parser is not breaking is_a_spam up, but treating it as
      one term.

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

* Re: notmuch_query_add_tag_exclude bug
  2018-03-11 13:19 ` David Bremner
@ 2018-03-11 14:55   ` Justus Winter
  0 siblings, 0 replies; 3+ messages in thread
From: Justus Winter @ 2018-03-11 14:55 UTC (permalink / raw)
  To: David Bremner, notmuch

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

David Bremner <david@tethera.net> writes:

> Justus Winter <justus@sequoia-pgp.org> writes:
>
>> Hi :)
>>
>> so I found a weird bug with notmuch_query_add_tag_exclude.  Apparently,
>> when I exclude 'spam', and search for 'spam', I still get results, but
>> if I exclude 'spam', and search for 'is_a_spam', I get no results, even
>> though there are mails tagged with that tag.
>>
>
> I'm not sure I follow you you. Can you try with
>
>     export NOTMUCH_DEBUG_QUERY=yes
>
> and see what the query terms are?
>
> The latter actually sounds legit assuming
>
>     - the excluded messages are tagged spam

Uh, actually they are, so there is no bug other than me being
confused...

Sorry for the noise...
Justus

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2018-03-11 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-04 10:26 notmuch_query_add_tag_exclude bug Justus Winter
2018-03-11 13:19 ` David Bremner
2018-03-11 14:55   ` Justus Winter

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