mirror of https://github.com/apache/lucene.git
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:
parent
7c80b7e7a0
commit
0b31a11206
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue