pub struct VectorInput<'a> {
pub vector: Cow<'a, [u8]>,
pub field_name: String,
pub weight: f32,
pub dtype: VectorDtype,
pub max_distance: f32,
}Expand description
A single vector input for MultiVectorQuery.
Mirrors the Python Vector dataclass from redisvl.query.aggregate.
Each input carries its own field name, weight, data type, and optional
maximum distance threshold.
Fields§
§vector: Cow<'a, [u8]>The encoded vector bytes.
field_name: StringRedis field name this vector targets.
weight: f32Weight applied when computing the combined score.
dtype: VectorDtypeData type of the vector elements.
max_distance: f32Maximum cosine distance threshold for range filtering (0.0–2.0).
Implementations§
Source§impl<'a> VectorInput<'a>
impl<'a> VectorInput<'a>
Sourcepub fn from_floats(elements: &[f32], field_name: impl Into<String>) -> Self
pub fn from_floats(elements: &[f32], field_name: impl Into<String>) -> Self
Creates a vector input from float elements, encoding them as float32 bytes.
Sourcepub fn from_bytes(
bytes: impl Into<Cow<'a, [u8]>>,
field_name: impl Into<String>,
dtype: VectorDtype,
) -> Self
pub fn from_bytes( bytes: impl Into<Cow<'a, [u8]>>, field_name: impl Into<String>, dtype: VectorDtype, ) -> Self
Creates a vector input from pre-encoded bytes.
Sourcepub fn with_weight(self, weight: f32) -> Self
pub fn with_weight(self, weight: f32) -> Self
Sets the weight for this vector.
Sourcepub fn with_dtype(self, dtype: VectorDtype) -> Self
pub fn with_dtype(self, dtype: VectorDtype) -> Self
Sets the data type.
Sourcepub fn with_max_distance(self, max_distance: f32) -> Self
pub fn with_max_distance(self, max_distance: f32) -> Self
Sets the maximum distance threshold (must be in 0.0–2.0).
§Panics
Panics if max_distance is outside the valid range.
Trait Implementations§
Source§impl<'a> Clone for VectorInput<'a>
impl<'a> Clone for VectorInput<'a>
Source§fn clone(&self) -> VectorInput<'a>
fn clone(&self) -> VectorInput<'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 VectorInput<'a>
impl<'a> RefUnwindSafe for VectorInput<'a>
impl<'a> Send for VectorInput<'a>
impl<'a> Sync for VectorInput<'a>
impl<'a> Unpin for VectorInput<'a>
impl<'a> UnsafeUnpin for VectorInput<'a>
impl<'a> UnwindSafe for VectorInput<'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.