[Xapian-discuss] How many docs to feed to an RSet?

Matthew Somerville matthew at mysociety.org
Mon Mar 3 18:56:05 GMT 2008

Richard Boulton wrote:
> The best answer is to play around, experiment, and see what seems to 
> work for you.

Something that will probably have to wait for some future time then :-)

> Incidentally, if you're just passing 500 to get an accurate result 
> count, you might want to try using the "checkatleast" parameter for 
> that, instead.  eg: get_mset(0,20,500).

Ah, thanks, presumably a hangover from when we were using a much older 
version of Xapian. It seems to be behaving oddly, though. With this PHP code 
for the values of N 0, 100, 500, and 1000:

     $m = $enquire->get_mset(0, 20, N);
     print $m->get_matches_estimated(). ' ';

I get:
         432 453 465 510

when the actual number of results is 463. The wiki says that if the number 
of results is less than checkatleast, get_matches_estimated() should return 
the exact result. As I increase the first argument to get_mset() it 
eventually starts returning the right result.

It's defaulting to collapse on value 3, in case that is doing something; if 
I switch that off, everything returns 594, the presumably correct result 


More information about the Xapian-discuss mailing list