pub struct VectorIndexBuilder { /* private fields */ }Expand description
Builder for VectorIndex.
Implementations§
Source§impl VectorIndexBuilder
impl VectorIndexBuilder
Sourcepub fn metric(self, metric: DistanceMetric) -> Self
pub fn metric(self, metric: DistanceMetric) -> Self
Set the distance metric.
Sourcepub fn config(self, config: HnswConfig) -> Self
pub fn config(self, config: HnswConfig) -> Self
Set the HNSW configuration (only effective for HNSW indexes).
This config is ignored when the builder was started with
VectorIndex::ivfflat — the index type is never changed by this
method. Use ivfflat_config to configure
IVFFlat indexes.
Sourcepub fn ivfflat_config(self, config: IvfFlatConfig) -> Self
pub fn ivfflat_config(self, config: IvfFlatConfig) -> Self
Set the IVFFlat configuration (only effective for IVFFlat indexes).
Sourcepub fn concurrent(self) -> Self
pub fn concurrent(self) -> Self
Create the index concurrently (non-blocking).
Sourcepub fn if_not_exists(self) -> Self
pub fn if_not_exists(self) -> Self
Add IF NOT EXISTS clause.
Sourcepub fn build(self) -> VectorResult<VectorIndex>
pub fn build(self) -> VectorResult<VectorIndex>
Build the index definition.
§Errors
Returns an error if the configuration is invalid, including if the
index name contains characters outside the identifier set (ASCII
alphanumeric, _, and . for schema-qualified names).
Trait Implementations§
Source§impl Clone for VectorIndexBuilder
impl Clone for VectorIndexBuilder
Source§fn clone(&self) -> VectorIndexBuilder
fn clone(&self) -> VectorIndexBuilder
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 moreAuto Trait Implementations§
impl Freeze for VectorIndexBuilder
impl RefUnwindSafe for VectorIndexBuilder
impl Send for VectorIndexBuilder
impl Sync for VectorIndexBuilder
impl Unpin for VectorIndexBuilder
impl UnsafeUnpin for VectorIndexBuilder
impl UnwindSafe for VectorIndexBuilder
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