For (1) - I can't explain it but I've run into documents with 0.0f scores. For (2) - this is a simple logic - if the lowest score in the queue is 'x' and you want to top docs only, then there's no point in attempting to insert a document with score lower than 'x' (it will not be added). Maybe I didn't understand your question correctly though ...
On Dec 11, 2007 2:25 PM, Timo Nentwig <[EMAIL PROTECTED]> wrote: > On Monday 10 December 2007 09:15:12 Paul Elschot wrote: > > The current TopDocCollector only allocates a ScoreDoc when the given > > score causes a new ScoreDoc to be added into the queue, but it does > > I actually wrote my own HitCollector and now wonder about TopDocCollector: > > public void collect(int doc, float score) { > if (score > 0.0f) { > totalHits++; > if (hq.size() < numHits || score >= minScore) { > hq.insert(new ScoreDoc(doc, score)); > minScore = ((ScoreDoc)hq.top()).score; // maintain minScore > } > } > } > > 1) How can there be hits with score=0.0? > 2) I don't understand minScore: inserts only document having a higher > score > than the lowest score already in queue? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Regards, Shai Erera