[][src]Struct tantivy::termdict::TermDictionary

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]

pub fn from_source(source: &ReadOnlySource) -> Self[src]

Opens a TermDictionary given a data source.

pub fn empty(field_type: &FieldType) -> Self[src]

Creates an empty term dictionary which contains no terms.

pub fn num_terms(&self) -> usize[src]

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]

Returns the ordinal associated to a given term.

pub fn ord_to_term(&self, ord: TermOrdinal, bytes: &mut Vec<u8>) -> bool[src]

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]

Returns the number of terms in the dictionary.

pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Option<TermInfo>[src]

Lookups the value corresponding to the key.

pub fn range(&self) -> TermStreamerBuilder[src]

Returns a range builder, to stream all of the terms within an interval.

pub fn stream(&self) -> TermStreamer[src]

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]

Returns a search builder, to stream all of the terms within the Automaton

Auto Trait Implementations

Blanket Implementations

impl<T> Fruit for T where
    T: Send + Downcast
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]