ScoreMetric

Score metric semantics exposed by storage.

Defines how similarity or relevance scores are computed and interpreted when querying a vector or document store.

Entries

Link copied to clipboard

Cosine similarity between two vectors, ranging from -1 to 1. A value of 1 indicates identical direction, 0 indicates orthogonality, and -1 indicates opposite direction. Higher values mean greater similarity.

Link copied to clipboard

Cosine distance between two vectors, defined as 1 - cosine_similarity, ranging from 0 to 2. A value of 0 indicates identical vectors, while 2 indicates opposite vectors. Lower values mean greater similarity.

Link copied to clipboard

Dot product (inner product) of two vectors. The value is unbounded and depends on vector magnitudes. Higher values indicate greater similarity when vectors are normalized.

Link copied to clipboard

Euclidean (L2) distance between two vectors, ranging from 0 to infinity. A value of 0 indicates identical vectors. Lower values mean greater similarity.

Link copied to clipboard

BM25 (Best Matching 25) text relevance score, commonly used in full-text search. The value is non-negative and unbounded. Higher values indicate greater relevance.

Link copied to clipboard

A hybrid score combining multiple retrieval strategies (e.g., vector similarity and keyword search). The range and interpretation depend on the specific combination and normalization used by the storage implementation.

Link copied to clipboard

A custom scoring metric defined by the storage implementation. The range and interpretation are implementation-specific.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.