Skip to content

Commit 9b31ce3

Browse files
authored
fix TestInt7HnswBackwardsCompatibility (#14460)
1 parent a8fb179 commit 9b31ce3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestInt7HnswBackwardsCompatibility.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
2222
import java.io.IOException;
2323
import org.apache.lucene.codecs.Codec;
24+
import org.apache.lucene.codecs.KnnVectorsFormat;
2425
import org.apache.lucene.codecs.KnnVectorsReader;
26+
import org.apache.lucene.codecs.lucene101.Lucene101Codec;
2527
import org.apache.lucene.codecs.lucene99.Lucene99HnswScalarQuantizedVectorsFormat;
2628
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat;
2729
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsReader;
@@ -67,10 +69,14 @@ public static Iterable<Object[]> testVersionsFactory() throws IllegalAccessExcep
6769
}
6870

6971
protected Codec getCodec() {
70-
return TestUtil.alwaysKnnVectorsFormat(
71-
new Lucene99HnswScalarQuantizedVectorsFormat(
72+
return new Lucene101Codec() {
73+
@Override
74+
public KnnVectorsFormat getKnnVectorsFormatForField(String field) {
75+
return new Lucene99HnswScalarQuantizedVectorsFormat(
7276
Lucene99HnswVectorsFormat.DEFAULT_MAX_CONN,
73-
Lucene99HnswVectorsFormat.DEFAULT_BEAM_WIDTH));
77+
Lucene99HnswVectorsFormat.DEFAULT_BEAM_WIDTH);
78+
}
79+
};
7480
}
7581

7682
@Override
Binary file not shown.

0 commit comments

Comments
 (0)