Show / Hide Table of Contents

Class VectorIndexConfiguration

Configuration for creating vector indexes.

Inheritance
System.Object
IndexConfiguration
VectorIndexConfiguration
Inherited Members
IndexConfiguration.Expressions
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Couchbase.Lite.Enterprise.Query
Assembly: Couchbase.Lite.dll
Syntax
public sealed class VectorIndexConfiguration : IndexConfiguration
Remarks

NOTE: This is an enterprise edition feature

Constructors

| Improve this Doc View Source

VectorIndexConfiguration(String, UInt32, UInt32)

Starts the creation of an index based on ML vector calcuations

Declaration
public VectorIndexConfiguration(string expression, uint dimensions, uint centroids)
Parameters
Type Name Description
System.String expression

The SQL++ expression returning a vector which is an array of numbers.

System.UInt32 dimensions

The 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 between 2 and 4096 inclusively.

System.UInt32 centroids

The 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 between 1 and 64000 inclusively.

Properties

| Improve this Doc View Source

Centroids

The number of centroids which is the number buckets to partition the vectors in the index.

Declaration
public uint Centroids { get; }
Property Value
Type Description
System.UInt32
Remarks

NOTE: This is an enterprise edition feature

| Improve this Doc View Source

Dimensions

The number of vector dimensions.

Declaration
public uint Dimensions { get; }
Property Value
Type Description
System.UInt32
Remarks

NOTE: This is an enterprise edition feature

| Improve this Doc View Source

DistanceMetric

The distance metric to use for vector measurement

Declaration
public DistanceMetric DistanceMetric { get; set; }
Property Value
Type Description
DistanceMetric
Remarks

NOTE: This is an enterprise edition feature

| Improve this Doc View Source

Encoding

Vector encoding type. The default value is 8-bits Scalar Quantizer.

Declaration
public VectorEncoding Encoding { get; set; }
Property Value
Type Description
VectorEncoding
Remarks

NOTE: This is an enterprise edition feature

| Improve this Doc View Source

Expression

The SQL++ expression returning a vector which is an array of numbers

Declaration
public string Expression { get; }
Property Value
Type Description
System.String
Remarks

NOTE: This is an enterprise edition feature

| Improve this Doc View Source

IsLazy

Gets or sets the boolean flag indicating if the index is lazy or not. The default value is false.

If the index is lazy, the index will not automatically updated when the documents in the collection are changed except when the documents are deleted or purged.

When using the lazy index mode, the expression set in the config must refer to the values that will be used later for computing vectors for the index instead of vector embeddings or prediction() function that returns vectors.

Please refer to the documentation for lazy indexes for further information on how to use them.

Declaration
public bool IsLazy { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

MaxTrainingSize

The max number of vectors used for training the index. The default value is zero, meaning that minTrainingSize will be automatically calculated by the index based on the number of centroids specified, encoding types, and the encoding parameters. The number must not be less than MinTrainingSize.

Declaration
public uint MaxTrainingSize { get; set; }
Property Value
Type Description
System.UInt32
Remarks

NOTE: This is an enterprise edition feature.

| Improve this Doc View Source

MinTrainingSize

The minium number of vectors for training the index. The default value is zero, meaning that minTrainingSize will be automatically calculated by the index based on the number of centroids specified, encoding types, and the encoding parameters. The number must not be greater than MaxTrainingSize.

Note

The training will occur at or before an APPROX_VECTOR_DISTANCE query is executed, provided there is enough data at that time, and consequently, if training is triggered during a query, the query may take longer to return results.

If a query is executed against the index before it is trained, a full scan of the vectors will be performed.If there are insufficient vectors in the database for training, a warning message will be logged, indicating the required number of vectors.

Declaration
public uint MinTrainingSize { get; set; }
Property Value
Type Description
System.UInt32

The minium number of vectors for training the index.

Remarks

NOTE: This is an enterprise edition feature.

| Improve this Doc View Source

NumProbes

The number of centroids that will be scanned during a query. The default value is zero, meaning that the numProbes will be automatically calulated by the index based on the number of centroids specified.

Declaration
public uint NumProbes { get; set; }
Property Value
Type Description
System.UInt32
Remarks

NOTE: This is an enterprise edition feature.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX