pub struct VectorStoreField {
pub field_type: FieldType,
pub name: String,
pub storage_name: Option<String>,
pub type_: Option<String>,
pub is_indexed: Option<bool>,
pub is_full_text_indexed: Option<bool>,
pub dimensions: Option<usize>,
pub index_kind: Option<IndexKind>,
pub distance_function: Option<DistanceFunction>,
}Expand description
One field in a vector-store collection.
Build with VectorStoreField::key, VectorStoreField::data or
VectorStoreField::vector, then refine with the builder methods —
mirroring upstream’s three __init__ overloads, but with the
field-type-specific options only reachable on the variant that accepts
them.
Fields§
§field_type: FieldType§name: StringThe field’s name on the record.
storage_name: Option<String>The field’s name in the store, when it differs from Self::name.
type_: Option<String>Provider-specific type hint (e.g. "str", "int"), passed through to
collection creation.
is_indexed: Option<bool>Whether the store should index this field for filtering.
is_full_text_indexed: Option<bool>Whether the store should index this field for full-text search.
dimensions: Option<usize>Vector fields only: the embedding’s dimensionality.
index_kind: Option<IndexKind>Vector fields only.
distance_function: Option<DistanceFunction>Vector fields only.
Implementations§
Source§impl VectorStoreField
impl VectorStoreField
Sourcepub fn key(name: impl Into<String>) -> VectorStoreField
pub fn key(name: impl Into<String>) -> VectorStoreField
The collection’s primary key field.
Sourcepub fn data(name: impl Into<String>) -> VectorStoreField
pub fn data(name: impl Into<String>) -> VectorStoreField
An ordinary payload field.
Sourcepub fn vector(name: impl Into<String>, dimensions: usize) -> VectorStoreField
pub fn vector(name: impl Into<String>, dimensions: usize) -> VectorStoreField
An embedding field of dimensions dimensions.
Sourcepub fn with_storage_name(
self,
storage_name: impl Into<String>,
) -> VectorStoreField
pub fn with_storage_name( self, storage_name: impl Into<String>, ) -> VectorStoreField
Store this field under a different name than the record uses.
Sourcepub fn with_type(self, type_: impl Into<String>) -> VectorStoreField
pub fn with_type(self, type_: impl Into<String>) -> VectorStoreField
Provider-specific type hint.
Sourcepub fn indexed(self) -> VectorStoreField
pub fn indexed(self) -> VectorStoreField
Index this field for filtering.
Sourcepub fn full_text_indexed(self) -> VectorStoreField
pub fn full_text_indexed(self) -> VectorStoreField
Index this field for full-text search.
Sourcepub fn with_index_kind(self, kind: IndexKind) -> VectorStoreField
pub fn with_index_kind(self, kind: IndexKind) -> VectorStoreField
Vector fields only; ignored by providers on other field types.
Sourcepub fn with_distance_function(
self,
function: DistanceFunction,
) -> VectorStoreField
pub fn with_distance_function( self, function: DistanceFunction, ) -> VectorStoreField
Vector fields only; ignored by providers on other field types.
Sourcepub fn effective_storage_name(&self) -> &str
pub fn effective_storage_name(&self) -> &str
The name this field is stored under: Self::storage_name when set,
otherwise Self::name.
Trait Implementations§
Source§impl Clone for VectorStoreField
impl Clone for VectorStoreField
Source§fn clone(&self) -> VectorStoreField
fn clone(&self) -> VectorStoreField
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more