@Override protected float score(DisiWrapper topList) throws IOException { double score = 0; for (DisiWrapper w = topList; w != null; w = w.next) { score += w.scorer.score(); } return (float)score; } }
@Override public void collect(int doc) throws IOException { final int i = doc & MASK; final int idx = i >>> 6; matching[idx] |= 1L << i; final Bucket bucket = buckets[i]; bucket.freq++; bucket.score += scorer.score(); } }
@Override public float score() throws IOException { double sum = 0.0d; for (Scorer scorer : scorers) { sum += scorer.score(); } return (float) sum; }
@Override public float score() throws IOException { return in.score(); }
@Override public float currentScore() { try { return currentScorer.score(); } catch ( IOException e ) { throw new RuntimeException( e ); } }
@Override public double doubleValue() throws IOException { return scorer.score(); }
@Override public float score() throws IOException { return reqScorer.score(); // reqScorer may be null when next() or skipTo() already return false }
@Override public double doubleValue() throws IOException { return scorer.score(); }
@Override protected float score(DisiWrapper topList) throws IOException { float scoreSum = 0; float scoreMax = Float.NEGATIVE_INFINITY; for (DisiWrapper w = topList; w != null; w = w.next) { final float subScore = w.scorer.score(); scoreSum += subScore; if (subScore > scoreMax) { scoreMax = subScore; } } return scoreMax + (scoreSum - scoreMax) * tieBreakerMultiplier; } }
@Override public void copy(int slot, int doc) throws IOException { scores[slot] = scorer.score(); assert !Float.isNaN(scores[slot]); }
@Override public int compareBottom(int doc) throws IOException { float score = scorer.score(); assert !Float.isNaN(score); return Float.compare(score, bottom); }
@Override public int compareTop(int doc) throws IOException { float docValue = scorer.score(); assert !Float.isNaN(docValue); return Float.compare(docValue, topValue); } }
@Override public float score() throws IOException { int doc = in.docID(); if (doc != curDoc) { curScore = in.score(); curDoc = doc; } return curScore; }
@Override public float score() throws IOException { // we need to know about all matches updateFreq(); double score = 0; for (DisiWrapper s = lead; s != null; s = s.next) { score += s.scorer.score(); } return (float) score; }
@Override protected void buffer(int doc) throws IOException { super.buffer(doc); scores[docCount] = scorer.score(); }
@Override public void collect(int doc) throws IOException { if (scorer.score() > 0) { in.collect(doc); } }
@Override public void collect(int doc) throws IOException { float score = scorer.score(); // This collector cannot handle these scores: assert score != Float.NEGATIVE_INFINITY; assert !Float.isNaN(score); totalHits++; if (score <= pqTop.score) { // Since docs are returned in-order (i.e., increasing doc Id), a document // with equal score to pqTop.score cannot compete since HitQueue favors // documents with lower doc Ids. Therefore reject those docs too. return; } pqTop.doc = doc + docBase; pqTop.score = score; pqTop = pq.updateTop(); }
@Override public final void collect( int doc ) throws IOException { docs.addDoc( doc ); if ( keepScores ) { if ( segmentHits >= scores.length ) { float[] newScores = new float[ArrayUtil.oversize( segmentHits + 1, 4 )]; System.arraycopy( scores, 0, newScores, 0, segmentHits ); scores = newScores; } scores[segmentHits] = scorer.score(); } segmentHits++; totalHits++; }
@Override public void collect(int doc) throws IOException { float score = scorer.score(); // This collector cannot handle these scores: assert score != Float.NEGATIVE_INFINITY; assert !Float.isNaN(score); totalHits++; if (score > after.score || (score == after.score && doc <= afterDoc)) { // hit was collected on a previous page return; } if (score <= pqTop.score) { // Since docs are returned in-order (i.e., increasing doc Id), a document // with equal score to pqTop.score cannot compete since HitQueue favors // documents with lower doc Ids. Therefore reject those docs too. return; } collectedHits++; pqTop.doc = doc + docBase; pqTop.score = score; pqTop = pq.updateTop(); } };
/** Returns the score of the current document matching the query. * Initially invalid, until the {@link #iterator()} is advanced the first time. * @return The score of the required scorer, eventually increased by the score * of the optional scorer when it also matches the current document. */ @Override public float score() throws IOException { // TODO: sum into a double and cast to float if we ever send required clauses to BS1 int curDoc = reqScorer.docID(); float score = reqScorer.score(); int optScorerDoc = optIterator.docID(); if (optScorerDoc < curDoc) { optScorerDoc = optIterator.advance(curDoc); } if (optScorerDoc == curDoc) { score += optScorer.score(); } return score; }