[Xapian-discuss] BM25

Olly Betts olly at survex.com
Wed Nov 10 00:51:41 GMT 2004

On Tue, Nov 09, 2004 at 09:56:37AM +0000, James Aylett wrote:
> Off the top of my head, if we moved the weighting classes into a
> subnamespace Xapian::Weight, we could rename BM25Weight to
> Xapian::Weight::BM25, and make a new constructor with a more sensible
> order /and/ fix C at the same time to remove our doubling
> factor.

That's a thought.  Although SWIG just ignores subnamespaces, which
doesn't sit well with this scheme.  It's already a pain for
Xapian::Auto::open() and the other database factory functions.

We could call it "Xapian::OkapiWeight" - BM25 is sometimes referred to as
"Okapi weighting" or some similar term, after the Okapi system which
BM25 was developed using (although Okapi actually supports at least BM11
and BM15 as well).

I think my preference is probably to just fix the parameter naming,
ordering, and the factor of 2, and keep the current class name, with a
prominent warning in the release notes.  While the API is mostly stable,
the pre-1.0 version number should hint that changes like this are possible.
0.9 is probably a suitable point to make such a change.

I don't believe many API users actually set parameters on BM25 at
present.  And besides if we make BM25Weight a deprecated wrapper around
<insert new name here>, anyone who does set parameters is going to have
to update their sources sooner or later when the wrapper is eventually
retired.  By just fixing it now, we can keep the natural name for
the class.


More information about the Xapian-discuss mailing list