Looking into TopDocCollector code, I have some questions:

* How can a hit have a score of <=0?
* What happens if the first hit has the highest score of all hits? It seems
that topDocs whould then contain only this doc!?

public void collect(int doc, float score) {
57     if (score > 0.0f) {
58       totalHits++;
59       if (hq.size() < numHits || score >= minScore) {
60         hq.insert(new ScoreDoc(doc, score));
61         minScore = ((ScoreDoc)hq.top()).score; // maintain minScore
62 }
63     }
64   }


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

Reply via email to