VectorIndexConfiguration
public struct VectorIndexConfiguration : IndexConfiguration, IndexConfigConvertable
ENTERPRISE EDITION ONLY
Configuration for creating vector indexes.
-
The SQL++ expression returning a vector which is an array of numbers
Declaration
Swift
public let expression: String -
The number of vector dimensions
Declaration
Swift
public let dimensions: UInt32 -
The number of centroids which is the number buckets to partition the vectors in the index.
Declaration
Swift
public let centroids: UInt32 -
Vector encoding type. The default value is 8-bits Scalar Quantizer.
Declaration
Swift
public var encoding: VectorEncoding -
Distance Metric type. The default value is euclidean.
Declaration
Swift
public var metric: DistanceMetric -
The minium number of vectors for training the index, an initial process for preparing an index based on the characteristics of the vectors to be indexed. Prior training, the full table scan will be peformed when the vector_match() function is used in the query.
The default value is 25 times number of centroids.The number must be more than zero and not greater than maxTrainingSize. An invalid argument error will be thrown when creating the index if an invalid value is used.
Declaration
Swift
public var minTrainingSize: UInt32 -
The max number of vectors used when trainning the index. The default value is 256 times number of centroids. The number must be more than zero and not less than the minTrainingSize. An invalid argument will be thrown when creating the index if an invalid value is used.
Declaration
Swift
public var maxTrainingSize: UInt32 -
Initializes the VectorIndexConfiguration.
Declaration
Swift
public init(expression: String, dimensions: UInt32, centroids: UInt32)Parameters
expressionThe SQL++ expression returning a vector which is an array of numbers.
dimensionsThe number of dimensions of the vectors to be indexed. The vectors that do not have the same dimensions specified in the config will not be indexed. The dimensions must be >= 1 and <= 2048.
centroidsThe number of centroids which is the number buckets to partition the vectors in the index. The number of centroids will be based on the expected number of vectors to be indexed; one suggested rule is to use the square root of the number of vectors. The centroids must be >= 1 and <= 64000.
-
[ScalarQuantizerType.SQ8] Vectors are encoded by using 8-bit Scalar Quantizer encoding, by default
Declaration
Swift
static let defaultEncoding: ScalarQuantizerType -
[DistanceMetric.euclidean] By default, vectors are compared using Euclidean metrics
Declaration
Swift
static let defaultDistanceMetric: DistanceMetric
VectorIndexConfiguration Structure Reference