X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-search.c;h=f6061e4ec08920273450bfba954473812110504f;hp=6d6c0e609490e842910b78a481a8f39a3c5c47d7;hb=c46764030d8d773d9d016b05fb274d5d12bb0907;hpb=d845662970c7627a7c6d03d4698119c2263c586f diff --git a/notmuch-search.c b/notmuch-search.c index 6d6c0e60..f6061e4e 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -210,6 +210,9 @@ do_search_threads (const search_format_t *format, int first_thread = 1; int i; + if (output == OUTPUT_THREADS) + notmuch_query_set_omit_excluded_messages (query, TRUE); + if (offset < 0) { offset += notmuch_query_count_threads (query); if (offset < 0) @@ -300,6 +303,8 @@ do_search_messages (const search_format_t *format, int first_message = 1; int i; + notmuch_query_set_omit_excluded_messages (query, TRUE); + if (offset < 0) { offset += notmuch_query_count_messages (query); if (offset < 0) @@ -371,6 +376,10 @@ do_search_tags (notmuch_database_t *notmuch, const char *tag; int first_tag = 1; + notmuch_query_set_omit_excluded_messages (query, TRUE); + /* should the following only special case if no excluded terms + * specified? */ + /* Special-case query of "*" for better performance. */ if (strcmp (notmuch_query_get_query_string (query), "*") == 0) { tags = notmuch_database_get_all_tags (notmuch);