On Tuesday 11 December 2007 14:32:12 Shai Erera wrote: > 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).
Sure. I didn't notice that score is passed as parameter and was surprised that subsequent calls to collect() are supposed to be guaranteed to have a lower score. Ok, stupid question :) > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]