Classes
FieldIndex
Internal Instances of theFieldIndex class represents a field index created by vector_index, keyword_index, or semantic_index functions.
FieldSpec
Internal Instances of theFieldSpec class represents a field specification created by text, int, float, bool, f32_vector, u8_vector, i8_vector, binary_vector, f32_sparse_vector, u8_sparse_vector, bytes, or list functions.
Methods
required()
FieldSpec
optional()
FieldSpec
index()
| Parameter | Type |
|---|---|
index | FieldIndex |
FieldSpec
Functions
text()
text values.
Example:
FieldSpec
int()
FieldSpec
float()
float values.
Example:
FieldSpec
bool()
bool values.
Example:
FieldSpec
f32_vector()
f32_vector values.
Example:
| Parameter | Type |
|---|---|
dimension | int |
FieldSpec
u8_vector()
u8_vector values.
Example:
| Parameter | Type |
|---|---|
dimension | int |
FieldSpec
i8_vector()
i8_vector values.
Example:
| Parameter | Type |
|---|---|
dimension | int |
FieldSpec
binary_vector()
binary_vector values.
Example:
| Parameter | Type |
|---|---|
dimension | int |
FieldSpec
f32_sparse_vector()
f32_sparse_vector values.
Note: Sparse vectors use u32 dimension indices to support dictionaries of up to 2^32 - 1 terms.
Example:
FieldSpec
u8_sparse_vector()
u8_sparse_vector values.
Note: Sparse vectors use u32 dimension indices to support dictionaries of up to 2^32 - 1 terms.
Example:
FieldSpec
bytes()
bytes values.
Example:
FieldSpec
list()
list values.
Example:
| Parameter | Type |
|---|---|
value_type | Literal[‘text’, ‘integer’, ‘float’] |
FieldSpec
vector_index()
vector_index values.
Supported metrics:
euclidean(only dense vectors)cosine(only dense vectors)dot_product(dense and sparse vectors)hamming(only binary vectors)
| Parameter | Type |
|---|---|
metric | Literal[‘cosine’, ‘euclidean’, ‘dot_product’, ‘hamming’] |
FieldIndex
keyword_index()
keyword_index values.
Example:
FieldIndex
semantic_index()
semantic_index values.
Supported models:
cohere/embed-english-v3cohere/embed-multilingual-v3cohere/embed-v4(default)
float32uint8binary
| Parameter | Type |
|---|---|
model | str |
FieldIndex