Apache Lucene open-source search software
Impl intoBitset and docIdRunEnd for wrappers (#14618)
Guo Fengcebfb0f415b4
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 22d8551bada..321cfc4d202 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -104,6 +104,8 @@ Optimizations* GITHUB#14447: Compute the doc range more efficiently when flushing doc block. (Pan Guixin)+* GITHUB#14529, GITHUB#14555, GITHUB#14618: Impl intoBitset for IndexedDISI and Docvalues. (Guo Feng)+Bug Fixes---------------------(No changes)diff --git a/lucene/core/src/java/org/apache/lucene/index/SingletonSortedNumericDocValues.java b/lucene/core/src/java/org/apache/lucene/index/SingletonSortedNumericDocValues.javaindex a1dabc69eeb..10783561819 100644--- a/lucene/core/src/java/org/apache/lucene/index/SingletonSortedNumericDocValues.java+++ b/lucene/core/src/java/org/apache/lucene/index/SingletonSortedNumericDocValues.java@@ -17,6 +17,7 @@package org.apache.lucene.index;import java.io.IOException;+import org.apache.lucene.util.FixedBitSet;/*** Exposes multi-valued view over a single-valued instance.@@ -62,6 +63,16 @@ final class SingletonSortedNumericDocValues extends SortedNumericDocValues {return in.advanceExact(target);}+ @Override+ public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException {+ in.intoBitSet(upTo, bitSet, offset);+ }++ @Override+ public int docIDRunEnd() throws IOException {+ return in.docIDRunEnd();+ }+@Overridepublic long cost() {return in.cost();diff --git a/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.java b/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.javaindex 7e57238e9ab..b72d8a4d0f8 100644--- a/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.java+++ b/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.java@@ -18,6 +18,7 @@ package org.apache.lucene.index;import java.io.IOException;import org.apache.lucene.util.BytesRef;+import org.apache.lucene.util.FixedBitSet;/*** Exposes multi-valued iterator view over a single-valued iterator.@@ -87,6 +88,16 @@ final class SingletonSortedSetDocValues extends SortedSetDocValues {return false;}+ @Override+ public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException {+ in.intoBitSet(upTo, bitSet, offset);+ }++ @Override+ public int docIDRunEnd() throws IOException {+ return in.docIDRunEnd();+ }+@Overridepublic BytesRef lookupOrd(long ord) throws IOException {// cast is ok: single-valued cannot exceed Integer.MAX_VALUE