lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <>
Subject zero boost / zero score
Date Tue, 12 Apr 2005 21:41:55 GMT
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

Test Program Output:
number of hits = 0
Found doc 0 with score NaN

Test Program: attached.


View raw message