[Xapian-discuss] Incorrect get_matches_estimated() of Xapian::Mset

Kevin Duraj kevin.softdev at gmail.com
Thu Sep 20 19:01:45 BST 2007


On 9/20/07, Olly Betts <olly at survex.com> wrote:
> On Thu, Sep 20, 2007 at 07:56:52PM +0800, Hightman(??????) wrote:
> > So I get an conclusion, XAPIAN count the estimate number by the
> > percentage of the FILTER term in all documents .... :(   How can I
> > fixed this error??
>
> It's not really an error - get_matches_estimated() returns an *estimate*
> so it's allowed to be wrong.  By default Xapian will favour retrieval
> speed over getting the estimate more correct.

Google search engine work similar, except Google overestimate the
number of page result that search engine has. If you search for some
very unique terms they display 10 pages on the bottom, and when you
click on the 10'th page is does not exist. Because the assumption is
that users rarely go beyond 2nd page and speed is more important than
having count exact number of matching documents.

Cheers,
   Kevin Duraj
   http://pacificair.com






> > But now, I found it get a disparity between the return value and real
> > mathced number. For an example: the real matched number is 58, but the
> > return value is 458; so when the users click the hinder page, get a
> > blank page ... so they often complain to me.
>
> If you want to ensure the estimate is correct below a certain value
> (e.g. to allow reliably generation of paging buttons in your UI), set
> the check_at_least parameter to Enquire::get_mset().  See the
> documentation for the details, or look at the code to Omega to see how
> it implements this.
>
> Cheers,
>    Olly
>
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>



More information about the Xapian-discuss mailing list