Skip to main content

SearchHit

Struct SearchHit 

Source
pub struct SearchHit {
    pub id: u64,
    pub kind: String,
    pub body: String,
    pub score: f64,
    pub branch: SoftFallbackBranch,
    pub source_id: Option<String>,
    pub ce_score: Option<f64>,
}
Expand description

A single structured search hit (G1 / AC-057a-clean).

Both retrieval branches emit this shape. id is the canonical row’s write_cursor — the interim identity carrier per dev/adr/ADR-0.8.0-canonical-identity-substrate.md; it swaps to logical_id at the G0 keystone (Slice 15) with no carrier reshape. score is the G9 RRF-fused relevance (Σ 1/(RRF_K + rank) over the branches that surfaced this body; higher = more relevant), optionally recency-reweighted when the dedicated recency flag is on. Raw vec_distance_l2 and bm25() are fused on rank, never compared raw (they are not comparable). branch tags which retrieval branch produced the representative hit (vector-first when a body is surfaced by both).

source_id (G0 Phase-2 / BLOCK-2) carries the source-document provenance of a hit. For the GraphArm branch it is the traversed edge’s source_id (the session the fact-edge was extracted from), enabling doc_id_of to resolve a graph-reached entity back to a gold session id. For every two-arm (vector/text/edge) hit it is None — those resolve via the cursor map. The field is additive and nullable; use_graph_arm=false results are byte-stable (every hit source_id == None).

Derives Clone, Debug, PartialEq but not Eqscore: f64 forbids total equality.

Fields§

§id: u64§kind: String§body: String§score: f64§branch: SoftFallbackBranch§source_id: Option<String>§ce_score: Option<f64>

0.8.5 (EXP-0) — per-candidate cross-encoder score ce_norm = sigmoid(ce_logit) ∈ [0,1]. Some ONLY for hits inside the reranked pool (the top pool_n when the CE model is loaded); None for the unreranked remainder, the rerank_depth == 0 identity path, an empty list, and the no-CE-model soft-fallback. Additive + nullable: it never participates in ranking, so default-path ordering/scores stay byte-stable.

Trait Implementations§

Source§

impl Clone for SearchHit

Source§

fn clone(&self) -> SearchHit

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SearchHit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SearchHit

Source§

fn eq(&self, other: &SearchHit) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SearchHit

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.