]> git.notmuchmail.org Git - notmuch/blobdiff - lib/query.cc
lib: make notmuch_query_count_messages explicitely exact
[notmuch] / lib / query.cc
index 9279915d21ccfbccb9ad9929a4089695a9f55928..57aa6d24844d49ced318f0148f99163bcc932a2a 100644 (file)
@@ -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();