pub struct RetrievalResult {
pub chunk: Chunk,
pub dense_score: Option<f32>,
pub sparse_score: Option<f32>,
pub multivector_score: Option<f32>,
pub fused_score: Option<f32>,
pub rerank_score: Option<f32>,
}Expand description
Result of a retrieval operation
Fields§
§chunk: ChunkThe retrieved chunk
dense_score: Option<f32>Dense retrieval score (if applicable)
sparse_score: Option<f32>Sparse retrieval score (if applicable)
multivector_score: Option<f32>Multi-vector retrieval score (if applicable, ColBERT-style MaxSim)
fused_score: Option<f32>Fused score (if hybrid retrieval)
rerank_score: Option<f32>Reranking score (if reranking applied)
Implementations§
Source§impl RetrievalResult
impl RetrievalResult
Sourcepub fn with_dense_score(self, score: f32) -> Self
pub fn with_dense_score(self, score: f32) -> Self
Set the dense score
Sourcepub fn with_sparse_score(self, score: f32) -> Self
pub fn with_sparse_score(self, score: f32) -> Self
Set the sparse score
Sourcepub fn with_fused_score(self, score: f32) -> Self
pub fn with_fused_score(self, score: f32) -> Self
Set the fused score
Sourcepub fn with_rerank_score(self, score: f32) -> Self
pub fn with_rerank_score(self, score: f32) -> Self
Set the rerank score
Sourcepub fn with_multivector_score(self, score: f32) -> Self
pub fn with_multivector_score(self, score: f32) -> Self
Set the multi-vector (ColBERT-style) score
Sourcepub fn best_score(&self) -> f32
pub fn best_score(&self) -> f32
Get the best available score (rerank > fused > multivector > dense > sparse)
Sourcepub fn best_score_with_multivector(&self) -> f32
pub fn best_score_with_multivector(&self) -> f32
Get the best available score including multi-vector score
Trait Implementations§
Source§impl Clone for RetrievalResult
impl Clone for RetrievalResult
Source§fn clone(&self) -> RetrievalResult
fn clone(&self) -> RetrievalResult
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 RetrievalResult
impl Debug for RetrievalResult
Source§impl<'de> Deserialize<'de> for RetrievalResult
impl<'de> Deserialize<'de> for RetrievalResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RetrievalResult
impl RefUnwindSafe for RetrievalResult
impl Send for RetrievalResult
impl Sync for RetrievalResult
impl Unpin for RetrievalResult
impl UnsafeUnpin for RetrievalResult
impl UnwindSafe for RetrievalResult
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