X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fquery.cc;h=57aa6d24844d49ced318f0148f99163bcc932a2a;hp=9279915d21ccfbccb9ad9929a4089695a9f55928;hb=6d44e5ac4743f618513c9a080733d91afa683f16;hpb=76f8498df61577c2f2e8f22e34a93a37ea532a03 diff --git a/lib/query.cc b/lib/query.cc index 9279915d..57aa6d24 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -587,7 +587,12 @@ notmuch_query_count_messages (notmuch_query_t *query) enquire.set_query (final_query); - mset = enquire.get_mset (0, notmuch->xapian_db->get_doccount ()); + /* + * Set the checkatleast parameter to the number of documents + * in the database to make get_matches_estimated() exact. + */ + mset = enquire.get_mset (0, notmuch->xapian_db->get_doccount (), + notmuch->xapian_db->get_doccount ()); count = mset.get_matches_estimated();