Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ Optimizations
* GITHUB#15607: Utilize bulk scoring for diversity checking when building HNSW vector indices. This results
in some performance improvements during indexing and segment merges. (Ben Trent)

* GITHUB#15658: DisjunctionMaxBulkScorer now uses progressive window sizing sub-scorers to be skipped
sooner when their scores are no longer competitive (Shimpei Kodama)


Bug Fixes
---------------------
* GITHUB#14161: PointInSetQuery's constructor now throws IllegalArgumentException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ private static class BulkScorerAndNext {
private final float[] windowScores = new float[WINDOW_SIZE];
private final PriorityQueue<BulkScorerAndNext> scorers;
private final SimpleScorable topLevelScorable = new SimpleScorable();
private int currentWindowSize = 1;

DisjunctionMaxBulkScorer(List<BulkScorer> scorers) {
if (scorers.size() < 2) {
Expand All @@ -64,7 +65,7 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr

while (top.next < max) {
final int windowMin = Math.max(top.next, min);
final int windowMax = MathUtil.unsignedMin(max, windowMin + WINDOW_SIZE);
final int windowMax = MathUtil.unsignedMin(max, windowMin + currentWindowSize);

// First compute matches / scores in the window
do {
Expand Down Expand Up @@ -105,6 +106,10 @@ public void collect(int doc) throws IOException {
collector.collect(doc);
}

if (currentWindowSize < WINDOW_SIZE) {
currentWindowSize = Math.min(currentWindowSize << 1, WINDOW_SIZE);
}

// Finally clean up state
windowMatches.clear();
Arrays.fill(windowScores, 0f);
Expand Down
Loading