You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gu...@apache.org on 2025/04/10 13:41:04 UTC
(lucene) 01/02: fix TestInt7HnswBackwardsCompatibility (#14460)
This is an automated email from the ASF dual-hosted git repository.
guofeng pushed a commit to branch branch_10_2
in repository https://gitbox.apache.org/repos/asf/lucene.git
commit f69d4aeaeaf25435f786700c8e7e6946be2d920e
Author: Guo Feng <52...@users.noreply.github.com>
AuthorDate: Thu Apr 10 19:36:13 2025 +0800
fix TestInt7HnswBackwardsCompatibility (#14460)
---
.../TestInt7HnswBackwardsCompatibility.java | 12 +++++++++---
.../apache/lucene/backward_index/int7_hnsw.10.1.0.zip | Bin 5530 -> 5439 bytes
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestInt7HnswBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestInt7HnswBackwardsCompatibility.java
index c45bf302c4f..554591709a2 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestInt7HnswBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestInt7HnswBackwardsCompatibility.java
@@ -21,7 +21,9 @@ import static org.apache.lucene.backward_index.TestBasicBackwardsCompatibility.a
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import java.io.IOException;
import org.apache.lucene.codecs.Codec;
+import org.apache.lucene.codecs.KnnVectorsFormat;
import org.apache.lucene.codecs.KnnVectorsReader;
+import org.apache.lucene.codecs.lucene101.Lucene101Codec;
import org.apache.lucene.codecs.lucene99.Lucene99HnswScalarQuantizedVectorsFormat;
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat;
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsReader;
@@ -67,10 +69,14 @@ public class TestInt7HnswBackwardsCompatibility extends BackwardsCompatibilityTe
}
protected Codec getCodec() {
- return TestUtil.alwaysKnnVectorsFormat(
- new Lucene99HnswScalarQuantizedVectorsFormat(
+ return new Lucene101Codec() {
+ @Override
+ public KnnVectorsFormat getKnnVectorsFormatForField(String field) {
+ return new Lucene99HnswScalarQuantizedVectorsFormat(
Lucene99HnswVectorsFormat.DEFAULT_MAX_CONN,
- Lucene99HnswVectorsFormat.DEFAULT_BEAM_WIDTH));
+ Lucene99HnswVectorsFormat.DEFAULT_BEAM_WIDTH);
+ }
+ };
}
@Override
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/int7_hnsw.10.1.0.zip b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/int7_hnsw.10.1.0.zip
index 350cf697f73..97515927f6e 100644
Binary files a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/int7_hnsw.10.1.0.zip and b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/int7_hnsw.10.1.0.zip differ