pub struct Document { /* private fields */ }
Expand description
Tantivy’s Document is the object that can be indexed and then searched for.
Documents are fundamentally a collection of unordered couple (field, value)
.
In this list, one field may appear more than once.
Documents are really just a list of couple (field, value)
.
In this list, one field may appear more than once.
Implementations
sourceimpl Document
impl Document
sourcepub fn add_facet<F>(&mut self, field: Field, path: F) where
Facet: From<F>,
pub fn add_facet<F>(&mut self, field: Field, path: F) where
Facet: From<F>,
Adding a facet to the document.
sourcepub fn add_pre_tokenized_text(
&mut self,
field: Field,
pre_tokenized_text: PreTokenizedString
)
pub fn add_pre_tokenized_text(
&mut self,
field: Field,
pre_tokenized_text: PreTokenizedString
)
Add a pre-tokenized text field.
sourcepub fn add_date(&mut self, field: Field, value: DateTime)
pub fn add_date(&mut self, field: Field, value: DateTime)
Add a date field with unspecified time zone offset
sourcepub fn add_json_object(&mut self, field: Field, json_object: Map<String, Value>)
pub fn add_json_object(&mut self, field: Field, json_object: Map<String, Value>)
Add a bytes field
sourcepub fn add_field_value<T: Into<Value>>(&mut self, field: Field, typed_val: T)
pub fn add_field_value<T: Into<Value>>(&mut self, field: Field, typed_val: T)
Add a (field, value) to the document.
sourcepub fn field_values(&self) -> &[FieldValue]
pub fn field_values(&self) -> &[FieldValue]
field_values accessor
sourcepub fn get_sorted_field_values(&self) -> Vec<(Field, Vec<&Value>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_sorted_field_values(&self) -> Vec<(Field, Vec<&Value>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Sort and groups the field_values by field.
The result of this method is not cached and is computed on the fly when this method is called.
Trait Implementations
sourceimpl BinarySerializable for Document
impl BinarySerializable for Document
sourceimpl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
sourcefn 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
sourceimpl From<Vec<FieldValue, Global>> for Document
impl From<Vec<FieldValue, Global>> for Document
sourcefn from(field_values: Vec<FieldValue>) -> Self
fn from(field_values: Vec<FieldValue>) -> Self
Converts to this type from the input type.
sourceimpl IntoIterator for Document
impl IntoIterator for Document
type Item = FieldValue
type Item = FieldValue
The type of the elements being iterated over.
type IntoIter = IntoIter<FieldValue, Global>
type IntoIter = IntoIter<FieldValue, Global>
Which kind of iterator are we turning this into?
impl Eq for Document
Auto Trait Implementations
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more