pub struct SearchDocument {
pub id: String,
pub title: Option<String>,
pub body: String,
pub metadata: BTreeMap<String, String>,
pub source: Option<TextSourceRef>,
pub provenance: Vec<TextProvenance>,
pub annotations: Vec<TextAnnotationSpan>,
}Expand description
Data type for search document.
Fields§
§id: StringIdentifier for this value.
title: Option<String>The title value.
body: StringThe body value.
metadata: BTreeMap<String, String>Metadata associated with this value.
source: Option<TextSourceRef>Optional rich source reference.
provenance: Vec<TextProvenance>Provenance records for this document.
annotations: Vec<TextAnnotationSpan>Annotation spans associated with this document.
Implementations§
Source§impl SearchDocument
impl SearchDocument
Sourcepub fn from_text_document(document: &TextDocument<'_>) -> Self
pub fn from_text_document(document: &TextDocument<'_>) -> Self
Builds this value from text document.
Sourcepub fn from_text_document_contract(document: &TextDocumentContract) -> Self
pub fn from_text_document_contract(document: &TextDocumentContract) -> Self
Builds this value from a portable text document contract.
Sourcepub fn from_text_segment_contract(segment: &TextSegmentContract) -> Self
pub fn from_text_segment_contract(segment: &TextSegmentContract) -> Self
Builds this value from a portable text segment contract.
Sourcepub fn from_text_corpus_document(document: &TextCorpusDocument) -> Self
pub fn from_text_corpus_document(document: &TextCorpusDocument) -> Self
Builds this value from a lexical corpus document without losing rich metadata.
Sourcepub fn from_text_corpus(corpus: &TextCorpus) -> Vec<Self>
pub fn from_text_corpus(corpus: &TextCorpus) -> Vec<Self>
Builds retrieval documents from a lexical corpus.
Trait Implementations§
Source§impl Clone for SearchDocument
impl Clone for SearchDocument
Source§fn clone(&self) -> SearchDocument
fn clone(&self) -> SearchDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchDocument
impl Debug for SearchDocument
Source§impl<'de> Deserialize<'de> for SearchDocument
impl<'de> Deserialize<'de> for SearchDocument
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
Source§impl PartialEq for SearchDocument
impl PartialEq for SearchDocument
Source§fn eq(&self, other: &SearchDocument) -> bool
fn eq(&self, other: &SearchDocument) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SearchDocument
impl Serialize for SearchDocument
impl StructuralPartialEq for SearchDocument
Auto Trait Implementations§
impl Freeze for SearchDocument
impl RefUnwindSafe for SearchDocument
impl Send for SearchDocument
impl Sync for SearchDocument
impl Unpin for SearchDocument
impl UnsafeUnpin for SearchDocument
impl UnwindSafe for SearchDocument
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