Re: C++ MatchDecider::operator() is const
Olly Betts <olly <at> survex.com>
2008-10-02 10:41:10 GMT
On Wed, Oct 01, 2008 at 05:54:20PM +0100, Richard Boulton wrote:
> Eric Sellin wrote:
> > Why is MatchDecider::operator() a const in the C++ API?
> > [...]
>
> That's a good question. I'm actually not certain it should be const,
> and perhaps it's something which should be fixed in future. However,
> fixing it would be a fairly intrusive API change, and would require any
> user subclasses to be updated, so I wouldn't be happy doing this until
> the 2.0 release (and I'm not convinced it's worth the effort, overall).
I'm pretty much convinced it isn't. The issue of whether this should be
const or not is arguable, but while "x.0" is a chance for making
incompatible changes when there's a good reason, it shouldn't be taken
as an excuse to change things just because we can. It requires users to
update their code, and complicates code which wants to support the old
and new APIs for a transitional period.
> Note, however, that Xapian does not give you any guarantees about the
> order in which the match decider is applied to documents, and doesn't
> guarantee that it will be called with all the potential matching
> documents. (At least, I don't think there's any guarantees about the
> order in which it will be presented with documents in the documentation
> anywhere - I'm willing to be disproved! It certainly often doesn't see
> all the potential matches.)
The intention is certainly that a MatchDecider should make an
independent decision about each document.
Currently the order is actually ascending docid order, but we certainly
(Continue reading)