LUCENE-2711: also use bulk sub-scorer API in BooleanScorer.nextDoc

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1023711 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-10-18 09:51:17 +00:00
parent 7c80b7e7a0
commit 0b31a11206
1 changed files with 5 additions and 9 deletions

View File

@ -69,7 +69,7 @@ final class BooleanScorer extends Scorer {
}
@Override
public final void collect(final int doc) throws IOException {
public void collect(final int doc) throws IOException {
final BucketTable table = bucketTable;
final int i = doc & BucketTable.MASK;
Bucket bucket = table.buckets[i];
@ -159,7 +159,7 @@ final class BooleanScorer extends Scorer {
return new BooleanScorerCollector(mask, this);
}
public final int size() { return SIZE; }
public int size() { return SIZE; }
}
static final class SubScorer {
@ -320,14 +320,10 @@ final class BooleanScorer extends Scorer {
more = false;
end += BucketTable.SIZE;
for (SubScorer sub = scorers; sub != null; sub = sub.next) {
Scorer scorer = sub.scorer;
sub.collector.setScorer(scorer);
int doc = scorer.docID();
while (doc < end) {
sub.collector.collect(doc);
doc = scorer.nextDoc();
int subScorerDocID = sub.scorer.docID();
if (subScorerDocID != NO_MORE_DOCS) {
more |= sub.scorer.score(sub.collector, end, subScorerDocID);
}
more |= (doc != NO_MORE_DOCS);
}
} while (bucketTable.first != null || more);