Struct tantivy::Document
[−]
[src]
pub struct Document { /* fields omitted */ }
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]
fn new() -> Document
Creates a new, empty document object
fn len(&self) -> usize
Returns the number of (field, value)
pairs.
fn is_empty(&self) -> bool
Returns true iff the document contains no fields.
fn add_text(&mut self, field: Field, text: &str)
Add a text field.
fn add_u64(&mut self, field: Field, value: u64)
Add a u64 field
fn add_i64(&mut self, field: Field, value: i64)
Add a u64 field
fn add(&mut self, field_value: FieldValue)
Add a field value
fn field_values(&self) -> &[FieldValue]
field_values accessor
fn get_sorted_field_values(&self) -> Vec<(Field, Vec<&FieldValue>)>
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.
fn get_all(&self, field: Field) -> Vec<&Value>
Returns all of the FieldValue
s associated the given field
fn get_first(&self, field: Field) -> Option<&Value>
Returns the first FieldValue
associated the given field
Trait Implementations
impl Debug for Document
[src]
impl Default for Document
[src]
impl PartialEq for Document
[src]
fn eq(&self, other: &Document) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Eq for Document
[src]
impl From<Vec<FieldValue>> for Document
[src]
fn from(field_values: Vec<FieldValue>) -> Document
Performs the conversion.