Trait tantivy::termdict::TermDictionary [] [src]

pub trait TermDictionary<'a> where
    Self: Sized
{ type Streamer: TermStreamer + 'a; type StreamBuilder: TermStreamerBuilder<Streamer = Self::Streamer> + 'a; fn from_source(source: ReadOnlySource) -> Self;
fn num_terms(&self) -> usize;
fn term_ord<K: AsRef<[u8]>>(&self, term: K) -> Option<TermOrdinal>;
fn ord_to_term(&self, ord: TermOrdinal, bytes: &mut Vec<u8>) -> bool;
fn term_info_from_ord(&self, term_ord: TermOrdinal) -> TermInfo;
fn get<K: AsRef<[u8]>>(&self, target_key: K) -> Option<TermInfo>;
fn range(&'a self) -> Self::StreamBuilder; fn stream(&'a self) -> Self::Streamer { ... }
fn stream_field(&'a self, field: Field) -> Self::Streamer { ... } }

Dictionary associating sorted &[u8] to values

Associated Types

Streamer type associated to the term dictionary

StreamerBuilder type associated to the term dictionary

Required Methods

Opens a TermDictionary given a data source.

Returns the number of terms in the dictionary. Term ordinals range from 0 to num_terms() - 1.

Returns the ordinal associated to a given term.

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.

Returns the number of terms in the dictionary.

Lookups the value corresponding to the key.

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

Provided Methods

A stream of all the sorted terms. See also .stream_field()

A stream of all the sorted terms in the given field.

Implementors