Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> getFilesFromSegment(Directory dir, String fileFormat) throws IOException {
return Arrays.stream(dir.listAll()).filter(x -> x.contains(fileFormat)).collect(Collectors.toList());
}
Expand Down