BaseKnnVectorsFormatTestCase
Base class aiming at testing vectors formats. To test a new format, all you need is to register a new Codec which uses it and extend this class and override .getCodec.
Functions
Creates a new directory and adds documents with the given vectors as kNN vector fields
This test is the best effort at verifying that checkIntegrity doesn't miss any files. It tests that the combination of opening a reader and calling checkIntegrity on it reads all bytes of all files.
The purpose of this test is to make sure that bulk merge doesn't accumulate useless data over runs.
Calls close multiple times on closeable codec apis
Index random vectors, sometimes skipping documents, sometimes deleting a document, sometimes merging, sometimes sorting the index, and verify that the expected values can be read back consistently.
Index random vectors as bytes, sometimes skipping documents, sometimes deleting a document, sometimes merging, sometimes sorting the index, and verify that the expected values can be read back consistently.
Tests exception handling on write and openInput/createOutput
Index random vectors, sometimes skipping documents, sometimes updating a document, sometimes merging, sometimes sorting the index, using an HNSW similarity function to also produce a graph, and verify that the expected values can be read back consistently.
Test that the query is a viable approximation to exact search. This test is designed to uncover gross failures only, not to represent the true expected recall.
Tests whether KnnVectorsReader.search implementations obey the limit on the number of visited vectors. This test is a best-effort attempt to capture the right behavior, and isn't meant to define a strict requirement on behavior.