Couchbase Lite C
Couchbase Lite C API
|
ENTERPRISE EDITION ONLY. More...
#include <cbl/CBLQueryIndexTypes.h>
Data Fields | |
CBLQueryLanguage | expressionLanguage |
The language used in the expressions (Required). More... | |
FLString | expression |
The expression could be specified in a JSON Array or in N1QL syntax depending on the expressionLanguage. More... | |
unsigned | dimensions |
The number of vector dimensions. More... | |
unsigned | centroids |
The number of centroids which is the number buckets to partition the vectors in the index. More... | |
bool | isLazy |
The boolean flag indicating that index is lazy or not. More... | |
CBLVectorEncoding * | encoding |
Vector encoding type. More... | |
CBLDistanceMetric | metric |
Distance Metric type. More... | |
unsigned | minTrainingSize |
The minimum number of vectors for training the index. More... | |
unsigned | maxTrainingSize |
The maximum number of vectors used for training the index. More... | |
unsigned | numProbes |
The number of centroids that will be scanned during a query. More... | |
ENTERPRISE EDITION ONLY.
Vector Index Configuration.
unsigned CBLVectorIndexConfiguration::centroids |
The number of centroids which is the number buckets to partition the vectors in the index.
(Required)
unsigned CBLVectorIndexConfiguration::dimensions |
The number of vector dimensions.
(Required)
CBLVectorEncoding* CBLVectorIndexConfiguration::encoding |
Vector encoding type.
The default value is 8-bits Scalar Quantizer.
FLString CBLVectorIndexConfiguration::expression |
The expression could be specified in a JSON Array or in N1QL syntax depending on the expressionLanguage.
(Required)
For non-lazy indexes, an expression returning either a vector, which is an array of 32-bit floating-point numbers, or a Base64 string representing an array of 32-bit floating-point numbers in little-endian order.
For lazy indexex, an expression returning a value for computing a vector lazily when using CBLIndexUpdater to add or update the vector into the index.
CBLQueryLanguage CBLVectorIndexConfiguration::expressionLanguage |
The language used in the expressions (Required).
bool CBLVectorIndexConfiguration::isLazy |
The boolean flag indicating that index is lazy or not.
The default value is false.
If the index is lazy, it will not be automatically updated when the documents in the collection are changed, except when the documents are deleted or purged.
When configuring the index to be lazy, the expression set to the config is the expression that returns a value used for computing the vector.
To update the lazy index, use a CBLIndexUpdater object, which can be obtained from a CBLQueryIndex object. To get a CBLQueryIndex object, call CBLCollection_GetIndex.
unsigned CBLVectorIndexConfiguration::maxTrainingSize |
The maximum number of vectors used for training the index.
The default value is zero, meaning that the maxTrainingSize will be determined based on the number of centroids, encoding types, and encoding parameters.
CBLDistanceMetric CBLVectorIndexConfiguration::metric |
Distance Metric type.
The default value is euclidean distance.
unsigned CBLVectorIndexConfiguration::minTrainingSize |
The minimum number of vectors for training the index.
The default value is zero, meaning that minTrainingSize will be determined based on the number of centroids, encoding types, and the encoding parameters.
unsigned CBLVectorIndexConfiguration::numProbes |
The number of centroids that will be scanned during a query.
The default value is zero, meaning that the numProbes will be determined based on the number of centroids.