Struct tantivy::termdict::TermDictionary [−][src]
pub struct TermDictionary { /* fields omitted */ }
The term dictionary contains all of the terms in
tantivy index
in a sorted manner.
The Fst
crate is used to associate terms to their
respective TermOrdinal
. The TermInfoStore
then makes it
possible to fetch the associated TermInfo
.
Methods
impl TermDictionary
[src]
impl TermDictionary
pub fn from_source(source: ReadOnlySource) -> Self
[src]
pub fn from_source(source: ReadOnlySource) -> Self
Opens a TermDictionary
given a data source.
pub fn empty(field_type: FieldType) -> Self
[src]
pub fn empty(field_type: FieldType) -> Self
Creates an empty term dictionary which contains no terms.
pub fn num_terms(&self) -> usize
[src]
pub fn num_terms(&self) -> usize
Returns the number of terms in the dictionary.
Term ordinals range from 0 to num_terms() - 1
.
pub fn term_ord<K: AsRef<[u8]>>(&self, key: K) -> Option<TermOrdinal>
[src]
pub fn term_ord<K: AsRef<[u8]>>(&self, key: K) -> Option<TermOrdinal>
Returns the ordinal associated to a given term.
pub fn ord_to_term(&self, ord: TermOrdinal, bytes: &mut Vec<u8>) -> bool
[src]
pub fn ord_to_term(&self, ord: TermOrdinal, bytes: &mut Vec<u8>) -> bool
Returns the term associated to a given term ordinal.
Term ordinals are defined as the position of the term in the sorted list of terms.
Returns true iff the term has been found.
Regardless of whether the term is found or not, the buffer may be modified.
pub fn term_info_from_ord(&self, term_ord: TermOrdinal) -> TermInfo
[src]
pub fn term_info_from_ord(&self, term_ord: TermOrdinal) -> TermInfo
Returns the number of terms in the dictionary.
pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Option<TermInfo>
[src]
pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Option<TermInfo>
Lookups the value corresponding to the key.
pub fn range<'a>(&'a self) -> TermStreamerBuilder<'a>
[src]
pub fn range<'a>(&'a self) -> TermStreamerBuilder<'a>
Returns a range builder, to stream all of the terms within an interval.
pub fn stream<'a>(&'a self) -> TermStreamer<'a>
[src]
pub fn stream<'a>(&'a self) -> TermStreamer<'a>
A stream of all the sorted terms. See also .stream_field()
pub fn search<'a, A: Automaton + 'a>(
&'a self,
automaton: A
) -> TermStreamerBuilder<'a, A>
[src]
pub fn search<'a, A: Automaton + 'a>(
&'a self,
automaton: A
) -> TermStreamerBuilder<'a, A>
Returns a search builder, to stream all of the terms within the Automaton
Auto Trait Implementations
impl Send for TermDictionary
impl Send for TermDictionary
impl Sync for TermDictionary
impl Sync for TermDictionary