diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/IndexedDISI.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/IndexedDISI.java index e50376ca706..639bdbd7333 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/IndexedDISI.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/IndexedDISI.java @@ -706,59 +706,4 @@ final class IndexedDISI extends DocIdSetIterator { disi.word = rankWord; disi.numberOfOnes = disi.denseOrigoIndex + denseNOO; } - - /** - * Implementation of a {@link DocIdSetIterator} which maps a source iterator to the indexes - * produced by an {@link IndexedDISI}. - * - *
This implementation assumes that all IDs produced by the source iterator are also present in - * the indexed iterator. - * - * @lucene.internal - */ - public static class MappedDISI extends DocIdSetIterator { - IndexedDISI indexedDISI; - DocIdSetIterator sourceDISI; - - public MappedDISI(IndexedDISI indexedDISI, DocIdSetIterator sourceDISI) { - this.indexedDISI = indexedDISI; - this.sourceDISI = sourceDISI; - } - - /** - * Advances the source iterator to the first document number that is greater than or equal to - * the provided target and returns the corresponding index. - */ - @Override - public int advance(int target) throws IOException { - int newTarget = sourceDISI.advance(target); - if (newTarget != NO_MORE_DOCS) { - indexedDISI.advance(newTarget); - } - return docID(); - } - - @Override - public long cost() { - return this.sourceDISI.cost(); - } - - @Override - public int docID() { - if (indexedDISI.docID() == NO_MORE_DOCS || sourceDISI.docID() == NO_MORE_DOCS) { - return NO_MORE_DOCS; - } - return indexedDISI.index(); - } - - /** Advances to the next document in the source iterator and returns the corresponding index. */ - @Override - public int nextDoc() throws IOException { - int newTarget = sourceDISI.nextDoc(); - if (newTarget != NO_MORE_DOCS) { - indexedDISI.advance(newTarget); - } - return docID(); - } - } } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene92/OffHeapFloatVectorValues.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene92/OffHeapFloatVectorValues.java index bcebd8823db..7c87bac5e54 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene92/OffHeapFloatVectorValues.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene92/OffHeapFloatVectorValues.java @@ -216,11 +216,6 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues { } }; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return new IndexedDISI.MappedDISI(disi, docIds); - } } private static class EmptyOffHeapVectorValues extends OffHeapFloatVectorValues { @@ -268,10 +263,5 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues { public VectorScorer scorer(float[] query) { return null; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return DocIdSetIterator.empty(); - } } } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapByteVectorValues.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapByteVectorValues.java index 336287d700c..0c428bb169f 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapByteVectorValues.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapByteVectorValues.java @@ -230,11 +230,6 @@ abstract class OffHeapByteVectorValues extends ByteVectorValues { } }; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return new IndexedDISI.MappedDISI(disi, docIds); - } } private static class EmptyOffHeapVectorValues extends OffHeapByteVectorValues { @@ -282,10 +277,5 @@ abstract class OffHeapByteVectorValues extends ByteVectorValues { public VectorScorer scorer(byte[] query) { return null; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return DocIdSetIterator.empty(); - } } } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapFloatVectorValues.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapFloatVectorValues.java index 2fa6daad417..b21df901ddb 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapFloatVectorValues.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene94/OffHeapFloatVectorValues.java @@ -229,11 +229,6 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues { } }; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return new IndexedDISI.MappedDISI(disi, docIds); - } } private static class EmptyOffHeapVectorValues extends OffHeapFloatVectorValues { @@ -281,10 +276,5 @@ abstract class OffHeapFloatVectorValues extends FloatVectorValues { public VectorScorer scorer(float[] query) { return null; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return DocIdSetIterator.empty(); - } } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/IndexedDISI.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/IndexedDISI.java index e6410595e05..dbd56125fcd 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/IndexedDISI.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/IndexedDISI.java @@ -758,59 +758,4 @@ public final class IndexedDISI extends DocIdSetIterator { disi.word = rankWord; disi.numberOfOnes = disi.denseOrigoIndex + denseNOO; } - - /** - * Implementation of a {@link DocIdSetIterator} which maps a source iterator to the indexes - * produced by an {@link IndexedDISI}. - * - *
This implementation assumes that all IDs produced by the source iterator are also present in - * the indexed iterator. - * - * @lucene.internal - */ - public static class MappedDISI extends DocIdSetIterator { - IndexedDISI indexedDISI; - DocIdSetIterator sourceDISI; - - public MappedDISI(IndexedDISI indexedDISI, DocIdSetIterator sourceDISI) { - this.indexedDISI = indexedDISI; - this.sourceDISI = sourceDISI; - } - - /** - * Advances the source iterator to the first document number that is greater than or equal to - * the provided target and returns the corresponding index. - */ - @Override - public int advance(int target) throws IOException { - int newTarget = sourceDISI.advance(target); - if (newTarget != NO_MORE_DOCS) { - indexedDISI.advance(newTarget); - } - return docID(); - } - - @Override - public long cost() { - return this.sourceDISI.cost(); - } - - @Override - public int docID() { - if (indexedDISI.docID() == NO_MORE_DOCS || sourceDISI.docID() == NO_MORE_DOCS) { - return NO_MORE_DOCS; - } - return indexedDISI.index(); - } - - /** Advances to the next document in the source iterator and returns the corresponding index. */ - @Override - public int nextDoc() throws IOException { - int newTarget = sourceDISI.nextDoc(); - if (newTarget != NO_MORE_DOCS) { - indexedDISI.advance(newTarget); - } - return docID(); - } - } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapByteVectorValues.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapByteVectorValues.java index 4dab8f49e53..1e78c8ea7aa 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapByteVectorValues.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapByteVectorValues.java @@ -272,11 +272,6 @@ public abstract class OffHeapByteVectorValues extends ByteVectorValues implement } }; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return new IndexedDISI.MappedDISI(disi, docIds); - } } private static class EmptyOffHeapVectorValues extends OffHeapByteVectorValues { @@ -327,10 +322,5 @@ public abstract class OffHeapByteVectorValues extends ByteVectorValues implement public VectorScorer scorer(byte[] query) { return null; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return DocIdSetIterator.empty(); - } } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapFloatVectorValues.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapFloatVectorValues.java index 310a42e1801..2384657e93e 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapFloatVectorValues.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene95/OffHeapFloatVectorValues.java @@ -268,11 +268,6 @@ public abstract class OffHeapFloatVectorValues extends FloatVectorValues impleme } }; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return new IndexedDISI.MappedDISI(disi, docIds); - } } private static class EmptyOffHeapVectorValues extends OffHeapFloatVectorValues { @@ -318,10 +313,5 @@ public abstract class OffHeapFloatVectorValues extends FloatVectorValues impleme public VectorScorer scorer(float[] query) { return null; } - - @Override - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return DocIdSetIterator.empty(); - } } } diff --git a/lucene/core/src/java/org/apache/lucene/index/ByteVectorValues.java b/lucene/core/src/java/org/apache/lucene/index/ByteVectorValues.java index aefaa7fa684..e9be3423c18 100644 --- a/lucene/core/src/java/org/apache/lucene/index/ByteVectorValues.java +++ b/lucene/core/src/java/org/apache/lucene/index/ByteVectorValues.java @@ -19,7 +19,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.List; import org.apache.lucene.document.KnnByteVectorField; -import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.VectorScorer; /** @@ -65,18 +64,6 @@ public abstract class ByteVectorValues extends KnnVectorValues { } } - /** - * Returns a new iterator that maps the provided docIds to the vector ordinals. - * - *
This method assumes that all docIds have corresponding ordinals. - * - * @lucene.internal - * @lucene.experimental - */ - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return docIds; - } - /** * Return a {@link VectorScorer} for the given query vector. * diff --git a/lucene/core/src/java/org/apache/lucene/index/FloatVectorValues.java b/lucene/core/src/java/org/apache/lucene/index/FloatVectorValues.java index 9467f8710a9..aa840fc3931 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FloatVectorValues.java +++ b/lucene/core/src/java/org/apache/lucene/index/FloatVectorValues.java @@ -19,7 +19,6 @@ package org.apache.lucene.index; import java.io.IOException; import java.util.List; import org.apache.lucene.document.KnnFloatVectorField; -import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.VectorScorer; /** @@ -65,18 +64,6 @@ public abstract class FloatVectorValues extends KnnVectorValues { } } - /** - * Returns a new iterator that maps the provided docIds to the vector ordinals. - * - *
This method assumes that all docIds have corresponding ordinals. - * - * @lucene.internal - * @lucene.experimental - */ - public DocIdSetIterator convertDocIdsToVectorOrdinals(DocIdSetIterator docIds) { - return docIds; - } - /** * Return a {@link VectorScorer} for the given query vector and the current {@link * FloatVectorValues}.