[][src]Struct tantivy::postings::SegmentPostings

pub struct SegmentPostings { /* fields omitted */ }

SegmentPostings represents the inverted list or postings associated to a term in a Segment.

As we iterate through the SegmentPostings, the frequencies are optionally decoded. Positions on the other hand, are optionally entirely decoded upfront.

Methods

impl SegmentPostings[src]

pub fn empty() -> Self[src]

Returns an empty segment postings object

pub fn create_from_docs(docs: &[u32]) -> SegmentPostings[src]

Creates a segment postings object with the given documents and no frequency encoded.

This method is mostly useful for unit tests.

It serializes the doc ids using tantivy's codec and returns a SegmentPostings object that embeds a buffer with the serialized data.

Trait Implementations

impl HasLen for SegmentPostings[src]

fn is_empty(&self) -> bool[src]

Returns true iff empty.

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.

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

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

impl DocSet for SegmentPostings[src]

fn doc(&self) -> DocId[src]

Return the current document's DocId.

Panics

Will panics if called without having called advance before.

fn fill_buffer(&mut self, buffer: &mut [DocId]) -> usize[src]

Fills a given mutable buffer with the next doc ids from the DocSet Read more

fn count(&mut self, delete_bitset: &DeleteBitSet) -> u32[src]

Returns the number documents matching. Calling this method consumes the DocSet. Read more

fn count_including_deleted(&mut self) -> u32[src]

Returns the count of documents, deleted or not. Calling this method consumes the DocSet. Read more

Auto Trait Implementations

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<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> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<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]