Enum tantivy::schema::IndexRecordOption
source · pub enum IndexRecordOption {
Basic,
WithFreqs,
WithFreqsAndPositions,
}
Expand description
IndexRecordOption
describes an amount information associated
with a given indexed field.
It is both used to:
- describe in the schema the amount of information that should be retained during indexing (See
TextFieldIndexing::set_index_option()
) - request that a given amount of information to be decoded as one goes through a posting list.
(See
InvertedIndexReader::read_postings()
)
Variants§
Basic
records only the DocId
s
WithFreqs
records the document ids as well as the term frequency. The term frequency can help giving better scoring of the documents.
WithFreqsAndPositions
records the document id, the term frequency and the positions of
the occurrences in the document.
Positions are required to run a PhraseQuery
.
Implementations§
source§impl IndexRecordOption
impl IndexRecordOption
sourcepub fn has_positions(self) -> bool
pub fn has_positions(self) -> bool
Returns true if this option include encoding term positions.
sourcepub fn downgrade(&self, other: IndexRecordOption) -> IndexRecordOption
pub fn downgrade(&self, other: IndexRecordOption) -> IndexRecordOption
Downgrades to the next level if provided IndexRecordOption
is unavailable.
Trait Implementations§
source§impl Clone for IndexRecordOption
impl Clone for IndexRecordOption
source§fn clone(&self) -> IndexRecordOption
fn clone(&self) -> IndexRecordOption
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for IndexRecordOption
impl Debug for IndexRecordOption
source§impl Default for IndexRecordOption
impl Default for IndexRecordOption
source§fn default() -> IndexRecordOption
fn default() -> IndexRecordOption
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for IndexRecordOption
impl<'de> Deserialize<'de> for IndexRecordOption
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
source§impl Hash for IndexRecordOption
impl Hash for IndexRecordOption
source§impl Ord for IndexRecordOption
impl Ord for IndexRecordOption
source§fn cmp(&self, other: &IndexRecordOption) -> Ordering
fn cmp(&self, other: &IndexRecordOption) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for IndexRecordOption
impl PartialEq for IndexRecordOption
source§fn eq(&self, other: &IndexRecordOption) -> bool
fn eq(&self, other: &IndexRecordOption) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for IndexRecordOption
impl PartialOrd for IndexRecordOption
source§fn partial_cmp(&self, other: &IndexRecordOption) -> Option<Ordering>
fn partial_cmp(&self, other: &IndexRecordOption) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for IndexRecordOption
impl Serialize for IndexRecordOption
impl Copy for IndexRecordOption
impl Eq for IndexRecordOption
impl StructuralPartialEq for IndexRecordOption
Auto Trait Implementations§
impl Freeze for IndexRecordOption
impl RefUnwindSafe for IndexRecordOption
impl Send for IndexRecordOption
impl Sync for IndexRecordOption
impl Unpin for IndexRecordOption
impl UnwindSafe for IndexRecordOption
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn 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.source§fn 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.