diff --git a/lucene/core/src/test/META-INF/services/org.apache.lucene.codecs.Codec b/lucene/core/src/test/META-INF/services/org.apache.lucene.codecs.Codec index 3905502af834..8c7c0df63966 100644 --- a/lucene/core/src/test/META-INF/services/org.apache.lucene.codecs.Codec +++ b/lucene/core/src/test/META-INF/services/org.apache.lucene.codecs.Codec @@ -15,4 +15,3 @@ org.apache.lucene.codecs.TestMinimalCodec$MinimalCodec org.apache.lucene.codecs.TestMinimalCodec$MinimalCompoundCodec -org.apache.lucene.search.TestRerankKnnFloatVectorQuery$QuantizedCodec diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRerankKnnFloatVectorQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestRerankKnnFloatVectorQuery.java index 533b09dccc73..fb8c9cf7e91c 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestRerankKnnFloatVectorQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestRerankKnnFloatVectorQuery.java @@ -19,9 +19,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Random; -import org.apache.lucene.codecs.FilterCodec; -import org.apache.lucene.codecs.KnnVectorsFormat; -import org.apache.lucene.codecs.lucene100.Lucene100Codec; import org.apache.lucene.codecs.lucene99.Lucene99HnswScalarQuantizedVectorsFormat; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -35,6 +32,7 @@ import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.apache.lucene.tests.util.LuceneTestCase; +import org.apache.lucene.tests.util.TestUtil; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -58,7 +56,8 @@ public void setUp() throws Exception { // Set up the IndexWriterConfig to use quantized vector storage config = new IndexWriterConfig(); - config.setCodec(new QuantizedCodec()); + config.setCodec( + TestUtil.alwaysKnnVectorsFormat(new Lucene99HnswScalarQuantizedVectorsFormat())); } @Test @@ -122,16 +121,4 @@ private float[] randomFloatVector(int dimension, Random random) { } return vector; } - - public static class QuantizedCodec extends FilterCodec { - - public QuantizedCodec() { - super("QuantizedCodec", new Lucene100Codec()); - } - - @Override - public KnnVectorsFormat knnVectorsFormat() { - return new Lucene99HnswScalarQuantizedVectorsFormat(); - } - } }