VectorField

class VectorField @JvmOverloads constructor(val path: String, val dimensions: Int, val metric: VectorMetric, val required: Boolean = false)(source)

The vector field of a store: where each document holds its vector, how many numbers the vector has, and how the distance between two vectors is measured (SPEC.md §11). It is a creation option, set with CreationOptions.withVectorField and fixed for the store's whole life.

In a store with a vector field, a document that has an array of dimensions numbers at path has that vector, kept as float32 values beside the document; the document itself stays as it was inserted. A document without a value at path, or with null there, has no vector; with required it's rejected instead. Anything else at path rejects the document.

A vector field is a value: two instances with the same settings are equal.

Throws InvalidJsonPathException when path isn't a JSON path that can name a document's vector, and IllegalArgumentException when dimensions is outside 1..MAX_DIMENSIONS.

Constructors

Link copied to clipboard
constructor(path: String, dimensions: Int, metric: VectorMetric, required: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

How many numbers every vector has, from 1 to MAX_DIMENSIONS.

Link copied to clipboard

How the distance between two vectors is measured.

Link copied to clipboard

The JSON path of the array that holds each document's vector: an RFC 9535 singular query without negative indexes, such as $.embedding, as type paths are (SPEC.md §6.1), and not $ itself.

Link copied to clipboard

Whether every document must have a vector: then one without a value at path, or with null there, is rejected.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String