pub struct RawHit {
pub id: Vec<u8>,
pub score: f32,
pub rerank_applied: bool,
pub degraded: bool,
pub metadata: Value,
pub source_op: SourceOp,
}Expand description
One pre-hydration retrieval hit. Operators flow these around between
each other; the final stage hydrates them into Hits.
Fields§
§id: Vec<u8>Backend-issued id (typically a ULID’s 16 bytes).
score: f32Score from the producing operator. Vector: cosine similarity.
Keyword: min-max normalized BM25. Fused: sum of 1 / (k + rank_i)
across branches. Reranked: cross-encoder logit (replaces upstream
score, see SourceOp::Reranked).
rerank_applied: boolWhether a cross-encoder reranker has been applied to this hit.
Plan 02-03’s rerank operator sets this to the value of
Reranker::applies() after the rerank pass — true when the real
BgeRerankerV2M3 ran, false when the NoopReranker passthrough
fallback ran (degraded model-missing path per RETRIEVE-06).
degraded: boolSet true by Plan 02-03’s degraded_fallback operator when this
hit came from the fallback (secondary) retriever after the primary
errored. Default false — every upstream operator (Vector, Keyword,
fuse_rrf, combinators, rerank) leaves it false; only the
degraded_fallback operator flips it on the fallback path. Hydration
copies this onto Hit::degraded so callers can tell whether the
result came from the primary backend or the fallback.
metadata: ValueFree-form metadata from the producing operator. Vector reads it from
the backend’s __metadata / payload column. Keyword reads it from
the backend’s payload column.
source_op: SourceOpWhich operator produced this hit. RRF fusion groups by this tag.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RawHit
impl<'de> Deserialize<'de> for RawHit
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawHit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawHit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for RawHit
impl Serialize for RawHit
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for RawHit
impl RefUnwindSafe for RawHit
impl Send for RawHit
impl Sync for RawHit
impl Unpin for RawHit
impl UnsafeUnpin for RawHit
impl UnwindSafe for RawHit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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