pub struct SearchConfig {
pub k: usize,
pub max_distance: Option<f32>,
pub ef_search: Option<usize>,
}Expand description
Configuration for search operations.
Fields§
§k: usizeMaximum number of results to return.
max_distance: Option<f32>Maximum distance threshold (only return results closer than this).
ef_search: Option<usize>Beam width for approximate search (HNSW ef_search parameter).
Implementations§
Source§impl SearchConfig
impl SearchConfig
Sourcepub const fn k_nearest(k: usize) -> Self
pub const fn k_nearest(k: usize) -> Self
Create a new search configuration for finding K nearest neighbors.
Sourcepub const fn within_distance(max_distance: f32) -> Self
pub const fn within_distance(max_distance: f32) -> Self
Create a search configuration for finding all vectors within a distance.
Sourcepub const fn with_ef_search(self, ef: usize) -> Self
pub const fn with_ef_search(self, ef: usize) -> Self
Set the beam width for approximate search.
Sourcepub const fn with_max_distance(self, max_distance: f32) -> Self
pub const fn with_max_distance(self, max_distance: f32) -> Self
Set the maximum distance threshold.
Trait Implementations§
Source§impl Clone for SearchConfig
impl Clone for SearchConfig
Source§fn clone(&self) -> SearchConfig
fn clone(&self) -> SearchConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 SearchConfig
impl Debug for SearchConfig
Source§impl Default for SearchConfig
impl Default for SearchConfig
impl Copy for SearchConfig
Auto Trait Implementations§
impl Freeze for SearchConfig
impl RefUnwindSafe for SearchConfig
impl Send for SearchConfig
impl Sync for SearchConfig
impl Unpin for SearchConfig
impl UnwindSafe for SearchConfig
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