Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSEARCH-4017 Don't scan index leaves that don't contain topdocs when applying projections #2370

Merged
merged 1 commit into from Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -13,7 +13,7 @@ final class ExplicitDocIdSetIterator extends DocIdSetIterator {
static DocIdSetIterator of(int[] sortedTopLevelDocIds, int leafDocBase, int leafMaxLeafId) {
int firstIndex = findFirstGreaterThanOrEqualTo( sortedTopLevelDocIds, leafDocBase );
if ( firstIndex < 0 ) {
return DocIdSetIterator.empty();
return null;
}
else {
return new ExplicitDocIdSetIterator( sortedTopLevelDocIds, leafDocBase, firstIndex, leafMaxLeafId );
Expand Down
Expand Up @@ -62,6 +62,9 @@ public Scorer scorer(LeafReaderContext context) {
DocIdSetIterator matchingDocs = ExplicitDocIdSetIterator.of(
sortedDocIds, context.docBase, context.reader().maxDoc()
);
if ( matchingDocs == null ) {
return null; // Skip this leaf
}
return new ConstantScoreScorer( this, this.score(), scoreMode, matchingDocs );
}

Expand Down