You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2025/03/14 14:46:22 UTC
(lucene) branch branch_10x updated: Improve DenseConjunctionBulkScorer's sparse fallback. (#14354)
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_10x by this push:
new 235c24215df Improve DenseConjunctionBulkScorer's sparse fallback. (#14354)
235c24215df is described below
commit 235c24215dff30b4b79d945a63629d951f40af00
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Fri Mar 14 15:45:52 2025 +0100
Improve DenseConjunctionBulkScorer's sparse fallback. (#14354)
`DenseConjunctionBulkScorer` has a fallback to sparse evaluation mode when the
intersection of the clauses evaluated so far becomes sparse. Currently, this
sparse evaluation mode clears bits in the window if they don't match new
clauses.
This change proposes to treat the bitset like any clause and evaluate the
conjunction in the traditional way, collecting matching docs one by one.
---
.../org/apache/lucene/search/DenseConjunctionBulkScorer.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lucene/core/src/java/org/apache/lucene/search/DenseConjunctionBulkScorer.java b/lucene/core/src/java/org/apache/lucene/search/DenseConjunctionBulkScorer.java
index 46599bbaba3..c1f6abd473a 100644
--- a/lucene/core/src/java/org/apache/lucene/search/DenseConjunctionBulkScorer.java
+++ b/lucene/core/src/java/org/apache/lucene/search/DenseConjunctionBulkScorer.java
@@ -223,18 +223,18 @@ final class DenseConjunctionBulkScorer extends BulkScorer {
otherDoc = other.advance(doc);
}
if (doc != otherDoc) {
- int clearUpTo = Math.min(WINDOW_SIZE, otherDoc - windowBase);
- windowMatches.clear(windowMatch, clearUpTo);
- windowMatch = advance(windowMatches, clearUpTo);
+ windowMatch = advance(windowMatches, otherDoc - windowBase);
continue advanceHead;
}
}
+ collector.collect(doc);
windowMatch = advance(windowMatches, windowMatch + 1);
}
+ } else {
+ docIdStreamView.windowBase = windowBase;
+ collector.collect(docIdStreamView);
}
- docIdStreamView.windowBase = windowBase;
- collector.collect(docIdStreamView);
windowMatches.clear();
}