pub struct Query {
pub vector: Vec<f32>,
pub k: usize,
pub filter: Option<FilterExpr>,
}Fields§
§vector: Vec<f32>§k: usize§filter: Option<FilterExpr>Implementations§
Source§impl Query
impl Query
Sourcepub fn with_limit(self, k: usize) -> Self
pub fn with_limit(self, k: usize) -> Self
Set the number of results to return
Sourcepub fn with_filter_expr(self, filter: FilterExpr) -> Self
pub fn with_filter_expr(self, filter: FilterExpr) -> Self
Add a filter expression
Sourcepub fn with_filter(self, filter_str: &str) -> Self
pub fn with_filter(self, filter_str: &str) -> Self
Add a filter from a string (parsed)
Note: This method ignores parse errors for builder pattern convenience.
Use try_with_filter() if you need error handling.
Sourcepub fn try_with_filter(self, filter_str: &str) -> Result<Self, Error>
pub fn try_with_filter(self, filter_str: &str) -> Result<Self, Error>
Add a filter from a string, returning an error if parsing fails
This is the strict version of with_filter() that returns errors instead
of silently ignoring them. (Major Issue #17 fix)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
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