[][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]

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.

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.

Auto Trait Implementations

Blanket Implementations

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]