pub struct CollectionConfig {
pub dimension: usize,
pub distance: Distance,
pub vector_space: Option<String>,
pub index: IndexConfig,
}Expand description
Collection-wide vector and index configuration.
Fields§
§dimension: usizeRequired number of components in every stored and query vector.
distance: DistanceDistance used to score vectors.
vector_space: Option<String>Optional application-defined vector-space identity checked by queries.
index: IndexConfigDeterministic approximate-index configuration.
Implementations§
Source§impl CollectionConfig
impl CollectionConfig
Sourcepub fn new(dimension: usize) -> Self
pub fn new(dimension: usize) -> Self
Creates a cosine collection configuration for the given dimension.
Sourcepub fn with_vector_space(self, vector_space: impl Into<String>) -> Self
pub fn with_vector_space(self, vector_space: impl Into<String>) -> Self
Assigns an application-defined vector-space identity.
Sourcepub fn with_index(self, index: IndexConfig) -> Self
pub fn with_index(self, index: IndexConfig) -> Self
Replaces deterministic approximate-query defaults.
The legacy LSH construction fields only affect format-version-1 roots.
Trait Implementations§
Source§impl Clone for CollectionConfig
impl Clone for CollectionConfig
Source§fn clone(&self) -> CollectionConfig
fn clone(&self) -> CollectionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CollectionConfig
impl Debug for CollectionConfig
Source§impl Default for CollectionConfig
impl Default for CollectionConfig
Source§impl<'de> Deserialize<'de> for CollectionConfigwhere
CollectionConfig: Default,
impl<'de> Deserialize<'de> for CollectionConfigwhere
CollectionConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CollectionConfig
Source§impl PartialEq for CollectionConfig
impl PartialEq for CollectionConfig
Source§impl Serialize for CollectionConfig
impl Serialize for CollectionConfig
impl StructuralPartialEq for CollectionConfig
Auto Trait Implementations§
impl Freeze for CollectionConfig
impl RefUnwindSafe for CollectionConfig
impl Send for CollectionConfig
impl Sync for CollectionConfig
impl Unpin for CollectionConfig
impl UnsafeUnpin for CollectionConfig
impl UnwindSafe for CollectionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more