pub enum MultiValueCombiner {
Sum,
Max,
Avg,
LogSumExp {
temperature: f32,
},
WeightedTopK {
k: usize,
decay: f32,
},
}Expand description
Strategy for combining scores when a document has multiple values for the same field
Variants§
Sum
Sum all scores (accumulates dot product contributions)
Max
Take the maximum score
Avg
Take the average score
LogSumExp
Log-Sum-Exp: smooth maximum approximation (default)
score = (1/t) * log(Σ exp(t * sᵢ))
Higher temperature → closer to max; lower → closer to mean
WeightedTopK
Weighted Top-K: weight top scores with exponential decay
score = Σ wᵢ * sorted_scores[i] where wᵢ = decay^i
Implementations§
Source§impl MultiValueCombiner
impl MultiValueCombiner
Sourcepub fn log_sum_exp() -> Self
pub fn log_sum_exp() -> Self
Create LogSumExp combiner with default temperature (1.5)
Sourcepub fn log_sum_exp_with_temperature(temperature: f32) -> Self
pub fn log_sum_exp_with_temperature(temperature: f32) -> Self
Create LogSumExp combiner with custom temperature
Sourcepub fn weighted_top_k() -> Self
pub fn weighted_top_k() -> Self
Create WeightedTopK combiner with defaults (k=5, decay=0.7)
Sourcepub fn weighted_top_k_with_params(k: usize, decay: f32) -> Self
pub fn weighted_top_k_with_params(k: usize, decay: f32) -> Self
Create WeightedTopK combiner with custom parameters
Trait Implementations§
Source§impl Clone for MultiValueCombiner
impl Clone for MultiValueCombiner
Source§fn clone(&self) -> MultiValueCombiner
fn clone(&self) -> MultiValueCombiner
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 moreSource§impl Debug for MultiValueCombiner
impl Debug for MultiValueCombiner
Source§impl Default for MultiValueCombiner
impl Default for MultiValueCombiner
Source§impl PartialEq for MultiValueCombiner
impl PartialEq for MultiValueCombiner
impl Copy for MultiValueCombiner
impl StructuralPartialEq for MultiValueCombiner
Auto Trait Implementations§
impl Freeze for MultiValueCombiner
impl RefUnwindSafe for MultiValueCombiner
impl Send for MultiValueCombiner
impl Sync for MultiValueCombiner
impl Unpin for MultiValueCombiner
impl UnwindSafe for MultiValueCombiner
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.