[][src]Trait tantivy::Postings

pub trait Postings: DocSet + 'static {
    fn term_freq(&self) -> u32;
fn positions_with_offset(&mut self, offset: u32, output: &mut Vec<u32>); fn positions(&mut self, output: &mut Vec<u32>) { ... } }

Postings (also called inverted list)

For a given term, it is the list of doc ids of the doc containing the term. Optionally, for each document, it may also give access to the term frequency as well as the list of term positions.

Its main implementation is SegmentPostings, but other implementations mocking SegmentPostings exist, for merging segments or for testing.

Required methods

fn term_freq(&self) -> u32

Returns the term frequency

fn positions_with_offset(&mut self, offset: u32, output: &mut Vec<u32>)

Returns the positions offseted with a given value. The output vector will be resized to the term_freq.

Loading content...

Provided methods

fn positions(&mut self, output: &mut Vec<u32>)

Returns the positions of the term in the given document. The output vector will be resized to the term_freq.

Loading content...

Implementors

impl Postings for SegmentPostings[src]

fn term_freq(&self) -> u32[src]

Returns the frequency associated to the current document. If the schema is set up so that no frequency have been encoded, this method should always return 1.

Panics

Will panics if called without having called advance before.

Loading content...