FlatVectorsReader

Reads vectors from an index. When searching this reader, it iterates every vector in the index and scores them

This class is useful when:

  • the number of vectors is small

  • when used along side some additional indexing structure that can be used to better search the vectors (like HNSW).

Inheritors

Properties

Link copied to clipboard

Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).

Link copied to clipboard
open override val mergeInstance: FlatVectorsReader

Returns an instance optimized for merging. This instance may only be consumed in the thread that called .getMergeInstance.

Link copied to clipboard

Scorer for flat vectors

Functions

Link copied to clipboard
abstract fun checkIntegrity()

Checks consistency of this reader.

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
open fun finishMerge()

Optional: reset or close merge resources used in the reader

Link copied to clipboard

Returns the ByteVectorValues for the given field. The behavior is undefined if the given field doesn't have KNN vectors enabled on its FieldInfo. The return value is never null.

Link copied to clipboard

Returns the FloatVectorValues for the given field. The behavior is undefined if the given field doesn't have KNN vectors enabled on its FieldInfo. The return value is never null.

Link copied to clipboard

Returns a RandomVectorScorer for the given field and target vector.

Link copied to clipboard
abstract fun ramBytesUsed(): Long

Return the memory usage of this object in bytes. Negative values are illegal.

Link copied to clipboard
open override fun search(field: String, target: ByteArray, knnCollector: KnnCollector, acceptDocs: Bits?)

Return the k nearest neighbor documents as determined by comparison of their vector values for this field, to the given vector, by the field's similarity function. The score of each document is derived from the vector similarity in a way that ensures scores are positive and that a larger score corresponds to a higher ranking.

open override fun search(field: String, target: FloatArray, knnCollector: KnnCollector, acceptDocs: Bits?)