pub struct RerankedDocument {
pub document: Document,
pub rerank_score: f32,
}Expand description
One reranked document paired with the score the Reranker assigned.
Two scores ride together: the inner Document::score carries the
original retrieval score from the VectorStore (or None if the
store did not surface one), and rerank_score carries the reranker’s
own score. Keeping them distinct preserves explainability — UIs and
dashboards can show “the embedding ranked this 0.82, the cross-encoder
ranked it 0.41 → moved from rank 1 to rank 7” without ambiguity, and
downstream filters can threshold on whichever score the deployment
trusts.
Fields§
§document: DocumentThe reranked document. Its score field still holds the
retrieval score from the originating VectorStore — the
reranker does not mutate it.
rerank_score: f32The reranker’s score for this document at this query. Comparable only within a single rerank call. Higher = better per the reranker’s scoring model.
Implementations§
Trait Implementations§
Source§impl Clone for RerankedDocument
impl Clone for RerankedDocument
Source§fn clone(&self) -> RerankedDocument
fn clone(&self) -> RerankedDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RerankedDocument
impl Debug for RerankedDocument
Source§impl<'de> Deserialize<'de> for RerankedDocument
impl<'de> Deserialize<'de> for RerankedDocument
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>,
Source§impl PartialEq for RerankedDocument
impl PartialEq for RerankedDocument
Source§fn eq(&self, other: &RerankedDocument) -> bool
fn eq(&self, other: &RerankedDocument) -> bool
self and other values to be equal, and is used by ==.