pub struct MultiVectorQuery<'a> { /* private fields */ }Expand description
Weighted multi-vector query using FT.AGGREGATE with per-vector range
searches.
Mirrors the Python MultiVectorQuery which composes multiple
VECTOR_RANGE clauses and computes a weighted combined_score via
APPLY steps.
Implementations§
Source§impl<'a> MultiVectorQuery<'a>
impl<'a> MultiVectorQuery<'a>
Sourcepub fn new(vectors: Vec<VectorInput<'a>>) -> Self
pub fn new(vectors: Vec<VectorInput<'a>>) -> Self
Creates a multi-vector query from one or more VectorInputs.
Sourcepub fn with_num_results(self, num_results: usize) -> Self
pub fn with_num_results(self, num_results: usize) -> Self
Sets the number of results to return.
Sourcepub fn with_filter(self, filter: FilterExpression) -> Self
pub fn with_filter(self, filter: FilterExpression) -> Self
Attaches a filter expression.
Sourcepub fn with_return_fields<I, S>(self, fields: I) -> Self
pub fn with_return_fields<I, S>(self, fields: I) -> Self
Replaces the return field list.
Sourcepub fn with_dialect(self, dialect: u32) -> Self
pub fn with_dialect(self, dialect: u32) -> Self
Sets the Redis dialect version.
Sourcepub fn vectors(&self) -> &[VectorInput<'a>]
pub fn vectors(&self) -> &[VectorInput<'a>]
Returns the vector inputs used by the query.
Sourcepub fn build_query_string(&self) -> String
pub fn build_query_string(&self) -> String
Builds the FT.AGGREGATE query string.
Mirrors the Python MultiVectorQuery.__str__() output:
@field_0:[VECTOR_RANGE max_dist_0 $vector_0]=>{$YIELD_DISTANCE_AS: distance_0}
AND @field_1:[VECTOR_RANGE max_dist_1 $vector_1]=>{$YIELD_DISTANCE_AS: distance_1}Sourcepub fn build_aggregate_cmd(&self, index_name: &str) -> Cmd
pub fn build_aggregate_cmd(&self, index_name: &str) -> Cmd
Builds the complete FT.AGGREGATE command.
Trait Implementations§
Source§impl<'a> Clone for MultiVectorQuery<'a>
impl<'a> Clone for MultiVectorQuery<'a>
Source§fn clone(&self) -> MultiVectorQuery<'a>
fn clone(&self) -> MultiVectorQuery<'a>
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<'a> Freeze for MultiVectorQuery<'a>
impl<'a> RefUnwindSafe for MultiVectorQuery<'a>
impl<'a> Send for MultiVectorQuery<'a>
impl<'a> Sync for MultiVectorQuery<'a>
impl<'a> Unpin for MultiVectorQuery<'a>
impl<'a> UnsafeUnpin for MultiVectorQuery<'a>
impl<'a> UnwindSafe for MultiVectorQuery<'a>
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 moreCreates a shared type from an unshared type.