pub struct KnnQuery {
pub field: String,
pub query_vector: Vec<f32>,
pub k: usize,
pub num_candidates: usize,
pub threshold: Option<f32>,
}Expand description
Approximate k-nearest-neighbor query on a dense_vector field.
See [[feature-knn-query-type]].
Fields§
§field: String§query_vector: Vec<f32>§k: usize§num_candidates: usize§threshold: Option<f32>Minimum score threshold. Results with score < threshold are excluded.
Score is metric-specific (see crate::vector::distance_to_score).
Auto Trait Implementations§
impl Freeze for KnnQuery
impl RefUnwindSafe for KnnQuery
impl Send for KnnQuery
impl Sync for KnnQuery
impl Unpin for KnnQuery
impl UnsafeUnpin for KnnQuery
impl UnwindSafe for KnnQuery
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> 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