lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject RE: can some access modifiers in be cha nged/"opened up"
Date Fri, 22 Feb 2002 18:18:25 GMT
> From: Spencer, Dave []
> Proposed solution is to change a couple of decls in Scorer and Query:
> 	make score() public
>       make all methods public or protected (normalize,
> sumOfSquaredWeights,prepare)

I'm a little hesitant.  These are internal APIs that it's nice to be able to
change without worrying about breaking other people's code.  Exposing them
is also likely to confuse most users, who should never need to call these.

So if we expose them we must first add Javadoc comments.  This should make
it clear that these methods are not for general consumption.  We should use
protected whereever possible.  (I use package private a lot in Lucene just
to keep the Javadoc API clean.)

Scorer.score() is a bit of an odd API.  It is called with increasing maxDoc
values and is expected to only score documents from the last maxDoc passed
(or zero initially) to the current maxDoc.  This is required for the
algorithm that BooleanQuery uses to optimize OR.

Someday (soon, hopefully) I'd like to write a new scorer that optimizes AND
much better--when all the terms are required you can skip through TermDocs.
I haven't yet worked out how the two algorithms will play together and what
the impact will be on the Scorer API, but it will probably change.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message