[−][src]Struct tantivy::Document
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.
Methods
impl Document
[src]
pub fn new() -> Document
[src]
Creates a new, empty document object
pub fn len(&self) -> usize
[src]
Returns the number of (field, value)
pairs.
pub fn is_empty(&self) -> bool
[src]
Returns true iff the document contains no fields.
pub fn filter_fields<P: Fn(Field) -> bool>(&mut self, predicate: P)
[src]
Retain only the field that are matching the predicate given in argument.
pub fn add_facet<F>(&mut self, field: Field, path: F) where
Facet: From<F>,
[src]
Facet: From<F>,
Adding a facet to the document.
pub fn add_text(&mut self, field: Field, text: &str)
[src]
Add a text field.
pub fn add_u64(&mut self, field: Field, value: u64)
[src]
Add a u64 field
pub fn add_i64(&mut self, field: Field, value: i64)
[src]
Add a i64 field
pub fn add_date(&mut self, field: Field, value: &DateTime)
[src]
Add a date field
pub fn add_bytes(&mut self, field: Field, value: Vec<u8>)
[src]
Add a bytes field
pub fn add(&mut self, field_value: FieldValue)
[src]
Add a field value
pub fn field_values(&self) -> &[FieldValue]
[src]
field_values accessor
pub fn get_sorted_field_values(&self) -> Vec<(Field, Vec<&FieldValue>)>
[src]
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.
pub fn get_all(&self, field: Field) -> Vec<&Value>
[src]
Returns all of the FieldValue
s associated the given field
pub fn get_first(&self, field: Field) -> Option<&Value>
[src]
Returns the first FieldValue
associated the given field
Trait Implementations
impl Default for Document
[src]
impl Clone for Document
[src]
fn clone(&self) -> Document
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Document> for Document
[src]
fn eq(&self, other: &Document) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl From<Vec<FieldValue>> for Document
[src]
fn from(field_values: Vec<FieldValue>) -> Self
[src]
impl Eq for Document
[src]
impl Debug for Document
[src]
impl Serialize for Document
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Document
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Sync for Document
impl Unpin for Document
impl Send for Document
impl UnwindSafe for Document
impl RefUnwindSafe for Document
Blanket Implementations
impl<T> Fruit for T where
T: Send + Downcast,
[src]
T: Send + Downcast,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,