diff --git a/src/main/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormat.java b/src/main/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormat.java index 6582cdd1f0..626210f250 100644 --- a/src/main/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormat.java +++ b/src/main/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormat.java @@ -29,7 +29,7 @@ public class NativeEngines990KnnVectorsFormat extends KnnVectorsFormat { /** The format for storing, reading, merging vectors on disk */ private static FlatVectorsFormat flatVectorsFormat; - private static final String FORMAT_NAME = "NativeEngines99KnnVectorsFormat"; + private static final String FORMAT_NAME = "NativeEngines990KnnVectorsFormat"; public NativeEngines990KnnVectorsFormat() { super(FORMAT_NAME); diff --git a/src/test/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormatTests.java b/src/test/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormatTests.java index 7bf17ec54c..f4f02ba918 100644 --- a/src/test/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormatTests.java +++ b/src/test/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsFormatTests.java @@ -14,6 +14,7 @@ import lombok.SneakyThrows; import lombok.extern.log4j.Log4j2; import org.apache.lucene.codecs.Codec; +import org.apache.lucene.codecs.hnsw.FlatVectorScorerUtil; import org.apache.lucene.codecs.hnsw.FlatVectorsReader; import org.apache.lucene.codecs.hnsw.FlatVectorsWriter; import org.apache.lucene.codecs.lucene99.Lucene99FlatVectorsFormat; @@ -226,6 +227,16 @@ public void testNativeEngineVectorFormat_whenBinaryQuantizationApplied_thenSucce indexReader.close(); } + public void testFormatName_withValidInput_thenSuccess() { + final String validFormatName = "NativeEngines990KnnVectorsFormat"; + Assert.assertEquals(validFormatName, new NativeEngines990KnnVectorsFormat().getName()); + Assert.assertEquals( + validFormatName, + new NativeEngines990KnnVectorsFormat(new Lucene99FlatVectorsFormat(FlatVectorScorerUtil.getLucene99FlatVectorsScorer())) + .getName() + ); + } + private List getFilesFromSegment(Directory dir, String fileFormat) throws IOException { return Arrays.stream(dir.listAll()).filter(x -> x.contains(fileFormat)).collect(Collectors.toList()); }