pub struct AnnConfig {
pub m: usize,
pub ef_construction: usize,
pub ef_search: usize,
pub max_results: usize,
pub enabled: bool,
pub min_vectors_for_ann: usize,
}Expand description
Configuration for ANN index construction.
Fields§
§m: usizeNumber of neighbors per node (higher = better recall, slower build). Default: 16
ef_construction: usizeSize of dynamic candidate list during construction (higher = better recall, slower build). Default: 200
ef_search: usizeSize of dynamic candidate list during search (higher = better recall, slower search). Default: 50
max_results: usizeMaximum number of results to return from ANN search. Default: 100
enabled: boolWhether to use ANN or fall back to linear scan. Default: true (use ANN when beneficial)
min_vectors_for_ann: usizeMinimum number of vectors before ANN is used. Below this threshold, linear scan is used even if enabled=true. Default: 1000
Implementations§
Source§impl AnnConfig
impl AnnConfig
pub fn with_m(self, m: usize) -> Self
pub fn with_ef_construction(self, ef: usize) -> Self
pub fn with_ef_search(self, ef: usize) -> Self
pub fn with_max_results(self, max: usize) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
pub fn with_min_vectors_for_ann(self, min: usize) -> Self
Sourcepub fn should_use_ann(&self, num_vectors: usize) -> bool
pub fn should_use_ann(&self, num_vectors: usize) -> bool
Check if ANN should be used given the current dataset size.
Trait Implementations§
impl Copy for AnnConfig
Auto Trait Implementations§
impl Freeze for AnnConfig
impl RefUnwindSafe for AnnConfig
impl Send for AnnConfig
impl Sync for AnnConfig
impl Unpin for AnnConfig
impl UnwindSafe for AnnConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more