pub struct Descriptor {
pub title: Option<CompactString>,
pub keywords: SmallVec<[CompactString; 8]>,
pub headings: SmallVec<[CompactString; 8]>,
pub heading_levels: SmallVec<[u8; 8]>,
pub tags: SmallVec<[CompactString; 8]>,
pub lang: Option<CompactString>,
pub snippet: CompactString,
pub embed_text: String,
pub bm25_terms: Vec<CompactString>,
pub links: Vec<CompactString>,
}Expand description
The distilled, indexable form of a document.
Fields§
§title: Option<CompactString>Display title, if found.
keywords: SmallVec<[CompactString; 8]>Top keywords/topics (most frequent discriminative terms).
headings: SmallVec<[CompactString; 8]>Section headings (H1–H3 / ATX), high-signal for retrieval.
heading_levels: SmallVec<[u8; 8]>Heading depths parallel to headings (1 = H1 …); empty when the
extractor cannot tell (code/plain text), in which case consumers fall
back to position-derived depths.
Structured tags (currently URL path components) for filtering.
lang: Option<CompactString>Detected language tag, if any.
snippet: CompactStringA short display snippet.
embed_text: StringThe distilled text handed to the embedder.
bm25_terms: Vec<CompactString>Normalized BM25 terms (also defines document length).
links: Vec<CompactString>Outbound link hrefs (raw, unresolved) discovered in the document.
Implementations§
Source§impl Descriptor
impl Descriptor
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether this descriptor carries no indexable content (no body/title terms). URL-path tags alone do not count as content.
Sourcepub fn into_document(
self,
url: Url,
kind: ResourceKind,
content_hash: u64,
vector: Vec<f32>,
) -> Document
pub fn into_document( self, url: Url, kind: ResourceKind, content_hash: u64, vector: Vec<f32>, ) -> Document
Convert into an index Document, pairing with a
resolved URL, content hash, and embedding vector.
Freshness fields (fetched_at_ms, etag, pinned) default to
unset/unpinned; callers that maintain a persisted knowledge base (the
facade) set them on the returned document before upserting.
Trait Implementations§
Source§impl Clone for Descriptor
impl Clone for Descriptor
Source§impl Debug for Descriptor
impl Debug for Descriptor
Auto Trait Implementations§
impl Freeze for Descriptor
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnsafeUnpin for Descriptor
impl UnwindSafe for Descriptor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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