pub struct MultiVectorQuery {
pub positive_vectors: Vec<Vec<f32>>,
pub positive_weights: Vec<f32>,
pub negative_vectors: Vec<Vec<f32>>,
pub negative_weights: Vec<f32>,
pub top_k: usize,
pub distance_threshold: Option<f32>,
}Expand description
Multi-vector query specification
Fields§
§positive_vectors: Vec<Vec<f32>>Positive vectors (search towards these)
positive_weights: Vec<f32>Weights for positive vectors
negative_vectors: Vec<Vec<f32>>Negative vectors (search away from these)
negative_weights: Vec<f32>Weights for negative vectors
top_k: usizeNumber of results to return
distance_threshold: Option<f32>Optional distance threshold
Implementations§
Source§impl MultiVectorQuery
impl MultiVectorQuery
Sourcepub fn with_negative(self, vector: Vec<f32>, weight: f32) -> Self
pub fn with_negative(self, vector: Vec<f32>, weight: f32) -> Self
Add a negative (avoidance) vector
Sourcepub fn with_threshold(self, threshold: f32) -> Self
pub fn with_threshold(self, threshold: f32) -> Self
Set distance threshold for range query
Sourcepub fn with_weights(self, weights: Vec<f32>) -> Self
pub fn with_weights(self, weights: Vec<f32>) -> Self
Set custom weights for positive vectors
Sourcepub fn compute_query_vector(&self, dimensions: usize) -> Vec<f32>
pub fn compute_query_vector(&self, dimensions: usize) -> Vec<f32>
Compute the effective query vector (weighted combination)
Trait Implementations§
Source§impl Clone for MultiVectorQuery
impl Clone for MultiVectorQuery
Source§fn clone(&self) -> MultiVectorQuery
fn clone(&self) -> MultiVectorQuery
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 moreAuto Trait Implementations§
impl Freeze for MultiVectorQuery
impl RefUnwindSafe for MultiVectorQuery
impl Send for MultiVectorQuery
impl Sync for MultiVectorQuery
impl Unpin for MultiVectorQuery
impl UnsafeUnpin for MultiVectorQuery
impl UnwindSafe for MultiVectorQuery
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