Classes
FieldIndex
Internal Instances of theFieldIndex class represents a field index created by vector_index, keyword_index, semantic_index, or multi_vector_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, list, struct, or matrix functions.
Methods
required()
FieldSpec
optional()
FieldSpec
index()
Returns
FieldSpec
Functions
text()
text values.
Example:
FieldSpec
int()
FieldSpec
float()
float values.
Example:
FieldSpec
bool()
bool values.
Example:
FieldSpec
f8_vector()
f8_vector values.
Example:
Returns
FieldSpec
f16_vector()
f16_vector values.
Example:
Returns
FieldSpec
f32_vector()
f32_vector values.
Example:
Returns
FieldSpec
u8_vector()
u8_vector values.
Example:
Returns
FieldSpec
i8_vector()
i8_vector values.
Example:
Returns
FieldSpec
binary_vector()
binary_vector values.
Example:
Returns
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
timestamp()
timestamp values.
Timestamps are stored as milliseconds since UNIX epoch.
When upserting timestamps, use:
datetime.datetime— timezone-aware datetime (timezone-naive datetimes are not supported)datetime.date— date (padded to midnight UTC)int— epoch milliseconds
FieldSpec
list()
list values.
Example:
Returns
FieldSpec
struct()
struct values.
Example:
Returns
FieldSpec
matrix()
matrix values.
Supported value_types:
f32f16f8u8i8
Returns
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)
Returns
FieldIndex
keyword_index()
keyword_index values.
Supported index types:
text(default) - text is tokenized before indexingexact- text is indexed as a single term
Returns
FieldIndex
semantic_index()
semantic_index values.
Example:
FieldIndex
multi_vector_index()
multi_vector_index values.
Supported metrics:
maxsim
Returns
FieldIndex
Type Aliases
SchemaFieldSpec
FieldSpec | Mapping[str, ‘SchemaFieldSpec’]