pub struct SearchDocument {
pub id: String,
pub content: String,
pub title: Option<String>,
pub fields: HashMap<String, Value>,
pub metadata: DocumentMetadata,
pub timestamp: DateTime<Utc>,
pub tags: Vec<String>,
pub language: Option<String>,
pub boost: f32,
}Expand description
Search document
Fields§
§id: StringDocument identifier
content: StringDocument content (full text)
title: Option<String>Document title
fields: HashMap<String, Value>Document fields
metadata: DocumentMetadataDocument metadata
timestamp: DateTime<Utc>Document timestamp
Document tags
language: Option<String>Document language
boost: f32Boost factor for search relevance
Implementations§
Source§impl SearchDocument
impl SearchDocument
Sourcepub fn builder() -> SearchDocumentBuilder
pub fn builder() -> SearchDocumentBuilder
Create new document builder
Sourcepub fn get_field<T>(&self, field: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
pub fn get_field<T>(&self, field: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
Get field value
Sourcepub fn field_names(&self) -> Vec<String>
pub fn field_names(&self) -> Vec<String>
Get all field names
Trait Implementations§
Source§impl Clone for SearchDocument
impl Clone for SearchDocument
Source§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
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