pub struct SearchHit {
pub resource: ResourceId,
pub locator: ResourceLocator,
pub score: f32,
pub signals: MatchSignals,
pub match: MatchReason,
pub metadata: ResourceMetadata,
pub heading: Option<String>,
pub preview: Option<String>,
pub query_index: usize,
}Expand description
One ranked match.
Fields§
§resource: ResourceId§locator: ResourceLocator§score: f32Relevance. In hybrid and lexical mode a rank fusion in (0, 1], where 1
means first on every signal that found anything; in semantic mode the
cosine similarity. Only comparable within one search.
signals: MatchSignalsWhat found this hit. Use it to tell a meaning match from a name match.
match: MatchReasonRank provenance, additive to the existing raw signal scores.
metadata: ResourceMetadata§heading: Option<String>Markdown heading path of the segment, when there is one.
preview: Option<String>A short excerpt of the matched segment (text resources only).
query_index: usizeIndex into SearchResults::queries of the query that scored best here.
Meaningful only when MatchSignals::semantic is present.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SearchHit
impl<'de> Deserialize<'de> for SearchHit
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
impl StructuralPartialEq for SearchHit
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
Mutably borrows from an owned value. Read more