[−][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_pre_tokenized_text(
&mut self,
field: Field,
pre_tokenized_text: &PreTokenizedString
)
[src]
&mut self,
field: Field,
pre_tokenized_text: &PreTokenizedString
)
Add a pre-tokenized 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_f64(&mut self, field: Field, value: f64)
[src]
Add a f64 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
pub fn prepare_for_store(&mut self)
[src]
Prepares Document for being stored in the document store
Method transforms PreTokenizedString values into String values.
Trait Implementations
impl Clone for Document
[src]
impl Debug for Document
[src]
impl Default for Document
[src]
impl<'de> Deserialize<'de> for Document
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Document
[src]
impl From<Vec<FieldValue>> for Document
[src]
fn from(field_values: Vec<FieldValue>) -> Self
[src]
impl PartialEq<Document> for Document
[src]
impl Serialize for Document
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
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, 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,