lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: zero boost / zero score
Date Wed, 13 Apr 2005 07:28:21 GMT
On Tuesday 12 April 2005 23:41, Yonik Seeley wrote:
> It seems like different search methods treat zero scoring docs a
> little differently.  Is this OK?
> 
> Some search methods on IndexSearcher check for score > 0.0f :
>     scorer.score(new HitCollector() {
>         public final void collect(int doc, float score) {
>           if (score > 0.0f &&			  // ignore zeroed buckets
> 
> The search method that accepts a HitCollector doesn't check for a score of 
0.
> I wrote a test program and got a surprising result... instead of
> getting a score of 0, I got a score of NaN.  Now the NaN is passed to
> the HitCollector, but excluded from the other search methods (since
> NaN > 0.0f is false.... only NaN != 0.0f would be true).  Is this
> intended/OK?

The NaN is from the division by the zero to normalize the score
for the query weights, so this is a feature.

I think for a document to be counted in the result of a query should only
depend on next(), skipTo()  and doc() of the scorer, and not on score().
However, other external code already depends on this code in IndexSearcher,
so I'm using another IndexSearcher that does not use the score.

Regards,
Paul Elschot.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message