pub struct SearchOptions {
pub k: usize,
pub min_similarity: Option<f32>,
pub max_distance: Option<f32>,
pub ef_search: Option<usize>,
pub include_query: bool,
}Expand description
Options for search queries.
Fields§
§k: usizeMaximum number of results to return.
min_similarity: Option<f32>Minimum similarity threshold (results below this are filtered).
max_distance: Option<f32>Maximum distance threshold.
ef_search: Option<usize>ef_search parameter override (higher = more accurate but slower).
include_query: boolWhether to include the query vector in results if it exists.
Implementations§
Source§impl SearchOptions
impl SearchOptions
Sourcepub fn with_min_similarity(self, threshold: f32) -> Self
pub fn with_min_similarity(self, threshold: f32) -> Self
Set minimum similarity threshold.
Sourcepub fn with_max_distance(self, distance: f32) -> Self
pub fn with_max_distance(self, distance: f32) -> Self
Set maximum distance threshold.
Sourcepub fn with_ef_search(self, ef: usize) -> Self
pub fn with_ef_search(self, ef: usize) -> Self
Set ef_search parameter.
Sourcepub fn include_query(self) -> Self
pub fn include_query(self) -> Self
Include query vector in results.
Trait Implementations§
Source§impl Clone for SearchOptions
impl Clone for SearchOptions
Source§fn clone(&self) -> SearchOptions
fn clone(&self) -> SearchOptions
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 SearchOptions
impl Debug for SearchOptions
Auto Trait Implementations§
impl Freeze for SearchOptions
impl RefUnwindSafe for SearchOptions
impl Send for SearchOptions
impl Sync for SearchOptions
impl Unpin for SearchOptions
impl UnwindSafe for SearchOptions
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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