mirror of https://github.com/djcb/mu.git
* mu-query-xapian: support batchsize == 0; use the db->get_doccount in that case
This commit is contained in:
parent
cf6c5d0a84
commit
0b3de03d9d
|
@ -174,11 +174,13 @@ mu_query_xapian_run (MuQueryXapian *self, const char* searchexpr,
|
|||
{
|
||||
g_return_val_if_fail (self, NULL);
|
||||
g_return_val_if_fail (searchexpr, NULL);
|
||||
g_return_val_if_fail (batchsize>0, NULL);
|
||||
|
||||
try {
|
||||
Xapian::Query q(get_query(self, searchexpr));
|
||||
Xapian::Enquire enq (*self->_db);
|
||||
|
||||
if (batchsize == 0)
|
||||
batchsize = self->_db->get_doccount();
|
||||
|
||||
if (sortfield)
|
||||
enq.set_sort_by_value (
|
||||
|
|
|
@ -71,7 +71,9 @@ char* mu_query_xapian_version (MuQueryXapian *store);
|
|||
* @param ascending if TRUE sort in ascending (A-Z) order, otherwise,
|
||||
* sort in descending (Z-A) order
|
||||
* @param batchsize the size of batches to receive; this is mainly for
|
||||
* reasons - it's best to get the size one wants to show the user at once
|
||||
* reasons - it's best to get the size one wants to show the user at once.
|
||||
* If you pass '0' as the batchsize, mu will use the maximum size (the count
|
||||
* of documents in the database)
|
||||
*
|
||||
* @return a MuMsgIterXapian instance you can iterate over, or NULL in
|
||||
* case of error
|
||||
|
|
Loading…
Reference in New Issue