pub struct SearchHit {Show 13 fields
pub id: EntityId,
pub title: String,
pub mem: String,
pub entity_type: String,
pub stub: bool,
pub score: f32,
pub tokens: usize,
pub snippet: Option<String>,
pub sections: HashMap<String, String>,
pub score_breakdown: Option<ScoreBreakdown>,
pub matched_terms: Option<HashMap<String, Vec<TermMatch>>>,
pub expansion: Option<ExpansionInfo>,
pub summary: Option<SummaryPair>,
}Expand description
A search result hit.
Fields§
§id: EntityId§title: String§mem: String§entity_type: String§stub: bool§score: f32§tokens: usize§snippet: Option<String>§sections: HashMap<String, String>Lead/key section bodies for the hit. The search op leaves this
empty — search finds entities, memstead_entity reads their
bodies; carrying every required section per hit overflowed the MCP
transport cap. The list op still populates it (its human-facing
roster consumers read the lead section as a one-line summary).
Empty maps are omitted from the serialized envelope.
score_breakdown: Option<ScoreBreakdown>Score component breakdown — populated when the call supplied a
text predicate; None on the metadata-only path.
matched_terms: Option<HashMap<String, Vec<TermMatch>>>Per-term match details keyed by query term — populated when the
call supplied a text predicate; None on the metadata-only path.
expansion: Option<ExpansionInfo>Expansion metadata — populated on hits reached via graph
expansion; None on primary hits.
summary: Option<SummaryPair>Lead-section summary resolved against the hit’s own mem schema
at search time (see SummaryPair). The renderer cannot resolve
it correctly on its own — the global type_by_name only sees the
default schema, so a software-schema hit (requirement →
Statement, actor → Role) would miss its anchor section and
render —. #[serde(skip)] keeps SearchHit’s wire shape
unchanged; the value surfaces on the envelope’s summary_heading /
summary_value. None only on hits built outside the engine
search op (FFI/bridge and test fixtures), where the renderer falls
back to the default-schema lookup.
Trait Implementations§
Source§impl Serialize for SearchHit
impl Serialize for SearchHit
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 SearchHit
impl RefUnwindSafe for SearchHit
impl Send for SearchHit
impl Sync for SearchHit
impl Unpin for SearchHit
impl UnsafeUnpin for SearchHit
impl UnwindSafe for SearchHit
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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