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.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun getKnownIndexStore(field: String, dimension: Int, vectorSimilarityFunction: VectorSimilarityFunction): Directory

Creates a new directory and adds documents with the given vectors as kNN vector fields

Link copied to clipboard
fun init()
Link copied to clipboard
Link copied to clipboard
open fun setUp()
Link copied to clipboard
fun tearDown()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun testAdvance()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The purpose of this test is to make sure that bulk merge doesn't accumulate useless data over runs.

Link copied to clipboard
Link copied to clipboard

Calls close multiple times on closeable codec apis

Link copied to clipboard
open fun testRandom()

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.

Link copied to clipboard
open fun testRandomBytes()

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.

Link copied to clipboard

Tests exception handling on write and openInput/createOutput

Link copied to clipboard

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.

Link copied to clipboard
open fun testRecall()

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.

Link copied to clipboard

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.

Link copied to clipboard
open fun testSortedIndex()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard