* mu-query-xapian: support batchsize == 0; use the db->get_doccount in that case
This commit is contained in:
@ -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 (self, NULL);
|
||||||
g_return_val_if_fail (searchexpr, NULL);
|
g_return_val_if_fail (searchexpr, NULL);
|
||||||
g_return_val_if_fail (batchsize>0, NULL);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Xapian::Query q(get_query(self, searchexpr));
|
Xapian::Query q(get_query(self, searchexpr));
|
||||||
Xapian::Enquire enq (*self->_db);
|
Xapian::Enquire enq (*self->_db);
|
||||||
|
|
||||||
|
if (batchsize == 0)
|
||||||
|
batchsize = self->_db->get_doccount();
|
||||||
|
|
||||||
if (sortfield)
|
if (sortfield)
|
||||||
enq.set_sort_by_value (
|
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,
|
* @param ascending if TRUE sort in ascending (A-Z) order, otherwise,
|
||||||
* sort in descending (Z-A) order
|
* sort in descending (Z-A) order
|
||||||
* @param batchsize the size of batches to receive; this is mainly for
|
* @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
|
* @return a MuMsgIterXapian instance you can iterate over, or NULL in
|
||||||
* case of error
|
* case of error
|
||||||
|
|||||||
Reference in New Issue
Block a user