VectorIndexConfigBuilder

Struct VectorIndexConfigBuilder 

Source
pub struct VectorIndexConfigBuilder {
    pub distance: Option<DistanceMetric>,
    pub ef: Option<i64>,
    pub ef_construction: Option<u64>,
    pub max_connections: Option<u64>,
    pub dynamic_ef_min: Option<i64>,
    pub dynamic_ef_max: Option<i64>,
    pub dynamic_ef_factor: Option<i64>,
    pub vector_cache_max_objects: Option<u64>,
    pub flat_search_cut_off: Option<u64>,
    pub cleanup_interval_seconds: Option<u64>,
    pub pq: Option<PqConfig>,
    pub skip: Option<bool>,
}
Expand description

VectorIndexConfigBuilder for building a new VectorIndexConfig

Fields§

§distance: Option<DistanceMetric>§ef: Option<i64>§ef_construction: Option<u64>§max_connections: Option<u64>§dynamic_ef_min: Option<i64>§dynamic_ef_max: Option<i64>§dynamic_ef_factor: Option<i64>§vector_cache_max_objects: Option<u64>§flat_search_cut_off: Option<u64>§cleanup_interval_seconds: Option<u64>§pq: Option<PqConfig>§skip: Option<bool>

Implementations§

Source§

impl VectorIndexConfigBuilder

Source

pub fn new() -> VectorIndexConfigBuilder

Create a new builder for the VectorIndexConfig object.

This is the same as VectorIndexConfig::builder().

§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new();
Source

pub fn with_distance(self, distance: DistanceMetric) -> VectorIndexConfigBuilder

Add a value to the optional distance value of the VectorIndexConfig.

§Parameters
  • distance: the distance to use for the vector index config
§Example
use weaviate_community::collections::schema::{VectorIndexConfigBuilder, DistanceMetric};

let builder = VectorIndexConfigBuilder::new().with_distance(DistanceMetric::COSINE);
Source

pub fn with_ef(self, ef: i64) -> VectorIndexConfigBuilder

Add a value to the optional ef value of the VectorIndexConfig.

§Parameters
  • ef: the ef to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_ef(10);
Source

pub fn with_ef_construction( self, ef_construction: u64, ) -> VectorIndexConfigBuilder

Add a value to the optional ef_construction value of the VectorIndexConfig.

§Parameters
  • ef_construction: the ef_construction to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_ef_construction(5);
Source

pub fn with_max_connections( self, max_connections: u64, ) -> VectorIndexConfigBuilder

Add a value to the optional max_connections value of the VectorIndexConfig.

§Parameters
  • max_connections: the max_connections to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_max_connections(5);
Source

pub fn with_dynamic_ef_min( self, dynamic_ef_min: i64, ) -> VectorIndexConfigBuilder

Add a value to the optional dynamic_ef_min value of the VectorIndexConfig.

§Parameters
  • dynamic_ef_min: the dynamic_ef_min to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_dynamic_ef_min(5);
Source

pub fn with_dynamic_ef_max( self, dynamic_ef_max: i64, ) -> VectorIndexConfigBuilder

Add a value to the optional dynamic_ef_max value of the VectorIndexConfig.

§Parameters
  • dynamic_ef_max: the dynamic_ef_max to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_dynamic_ef_max(10);
Source

pub fn with_dynamic_ef_factor( self, dynamic_ef_factor: i64, ) -> VectorIndexConfigBuilder

Add a value to the optional dynamic_ef_factor value of the VectorIndexConfig.

§Parameters
  • dynamic_ef_factor: the dynamic_ef_factor to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_dynamic_ef_factor(3);
Source

pub fn with_vector_cache_max_objects( self, vector_cache_max_objects: u64, ) -> VectorIndexConfigBuilder

Add a value to the optional vector_cache_max_objects value of the VectorIndexConfig.

§Parameters
  • vector_cache_max_objects: the vector_cache_max_objects to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_vector_cache_max_objects(3);
Source

pub fn with_flat_search_cut_off( self, flat_search_cut_off: u64, ) -> VectorIndexConfigBuilder

Add a value to the optional flat_search_cut_off value of the VectorIndexConfig.

§Parameters
  • flat_search_cut_off: the flat_search_cut_off to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_flat_search_cut_off(3);
Source

pub fn with_cleanup_interval_seconds( self, cleanup_interval_seconds: u64, ) -> VectorIndexConfigBuilder

Add a value to the optional cleanup_interval_seconds value of the VectorIndexConfig.

§Parameters
  • cleanup_interval_seconds: the cleanup_interval_seconds to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_cleanup_interval_seconds(3);
Source

pub fn with_pq(self, pq: PqConfig) -> VectorIndexConfigBuilder

Add a value to the optional pq value of the VectorIndexConfig.

§Parameters
  • pq: the pq config to use for the vector index config
§Example
use weaviate_community::collections::schema::{
    VectorIndexConfigBuilder,
    PqConfig
};

let pq_config = PqConfig::builder().build();
let builder = VectorIndexConfigBuilder::new().with_pq(pq_config);
Source

pub fn with_skip(self, skip: bool) -> VectorIndexConfigBuilder

Add a value to the optional skip value of the VectorIndexConfig.

§Parameters
  • skip: the skip to use for the vector index config
§Example
use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let builder = VectorIndexConfigBuilder::new().with_skip(true);
Source

pub fn build(self) -> VectorIndexConfig

Build the VectorIndexConfig from the VectorIndexConfigBuilder

§Example

Using VectorIndexConfigBuilder

use weaviate_community::collections::schema::VectorIndexConfigBuilder;

let config = VectorIndexConfigBuilder::new().build();

Using VectorIndexConfig

use weaviate_community::collections::schema::VectorIndexConfig;

let config = VectorIndexConfig::builder().build();

Trait Implementations§

Source§

impl Default for VectorIndexConfigBuilder

Source§

fn default() -> VectorIndexConfigBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more