[][src]Struct tantivy::postings::BlockSegmentPostings

pub struct BlockSegmentPostings { /* fields omitted */ }

BlockSegmentPostings is a cursor iterating over blocks of documents.

Warning

While it is useful for some very specific high-performance use cases, you should prefer using SegmentPostings for most usage.

Methods

impl BlockSegmentPostings[src]

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

Returns the document frequency associated to this block postings.

This doc_freq is simply the sum of the length of all of the blocks length, and it does not take in account deleted documents.

pub fn docs(&self) -> &[DocId][src]

Returns the array of docs in the current block.

Before the first call to .advance(), the block returned by .docs() is empty.

pub fn doc(&self, idx: usize) -> u32[src]

Return the document at index idx of the block.

pub fn freqs(&self) -> &[u32][src]

Return the array of term freq in the block.

pub fn freq(&self, idx: usize) -> u32[src]

Return the frequency at index idx of the block.

pub fn skip_to(&mut self, target_doc: DocId) -> BlockSegmentPostingsSkipResult[src]

position on a block that may contains doc_id. Always advance the current block.

Returns true if a block that has an element greater or equal to the target is found. Returning true does not guarantee that the smallest element of the block is smaller than the target. It only guarantees that the last element is greater or equal.

Returns false iff all of the document remaining are smaller than doc_id. In that case, all of these document are consumed.

pub fn advance(&mut self) -> bool[src]

Advance to the next block.

Returns false iff there was no remaining blocks.

pub fn empty() -> BlockSegmentPostings[src]

Returns an empty segment postings object

Trait Implementations

impl<'b> Streamer<'b> for BlockSegmentPostings[src]

type Item = &'b [DocId]

The type of the item emitted by this stream.

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

impl<'a, S> IntoStreamer<'a> for S where
    S: Streamer<'a>, 
[src]

type Item = <S as Streamer<'a>>::Item

The type of the item emitted by the stream.

type Into = S

The type of the stream to be constructed.