diff options
| author | Jani Nikula <jani@nikula.org> | 2014-10-14 19:32:54 +0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-03-13 07:58:55 +0100 |
| commit | 6d44e5ac4743f618513c9a080733d91afa683f16 (patch) | |
| tree | af98d5783411b5f2d216d63ed7bca54945287e68 /lib/query.cc | |
| parent | 76f8498df61577c2f2e8f22e34a93a37ea532a03 (diff) | |
lib: make notmuch_query_count_messages explicitely exact
The default is actually exact if no checkatleast parameter is
specified. This change makes that explicit, mainly for documentation,
but also to be safe in the unlikely event of a change of default.
[ commit message rewritten by db based on id:87lho0nlkk.fsf@nikula.org
]
Diffstat (limited to 'lib/query.cc')
| -rw-r--r-- | lib/query.cc | 7 |
1 files changed, 6 insertions, 1 deletions
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(); |
