Gaute Hope <eg@gaute.vetsj.com> writes: >> > > Ok, that explains it. You are right - I mixed up, the count is correct. > > regards, gaute At the end of this message is a simpler example, that I think demonstrates a bug. At the very list it's not very nice that the destructiveness only shows up when excludes are involved. Here is the output; note the second exclude query! ,---- | ╭─ maritornes:~/tmp | ╰─% NOTMUCH_DEBUG_QUERY=1 ./a.out | Query string is: | tag:muted | Exclude query is: | Xapian::Query() | Final query is: | Xapian::Query((Tmail AND 0 * Kmuted)) | ret1=84 | Exclude query is: | Xapian::Query(<alldocuments>) | Final query is: | Xapian::Query(((Tmail AND 0 * Kmuted) AND_NOT <alldocuments>)) | ret2=0 `---- #include <notmuch.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char **argv){ notmuch_database_t *nm_db; notmuch_query_t *query; if (notmuch_database_open ("/home/bremner/Maildir/", NOTMUCH_DATABASE_MODE_READ_ONLY, &nm_db)) return 1; query = notmuch_query_create (nm_db, "tag:muted"); notmuch_query_add_tag_exclude (query, "muted"); notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_TRUE); printf("ret1=%d\n", notmuch_query_count_threads (query)); printf("ret2=%d\n", notmuch_query_count_threads (query)); }