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

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.

Implementations

impl BlockSegmentPostings[src]

pub fn block_max_score(
    &mut self,
    fieldnorm_reader: &FieldNormReader,
    bm25_weight: &BM25Weight
) -> Score
[src]

Returns the block_max_score for the current block. It does not require the block to be loaded. For instance, it is ok to call this method after having called .shallow_advance(..).

See TermScorer::block_max_score(..) for more information.

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

Returns the overall number of documents in the block postings. It does not take in account whether documents are deleted or not.

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]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[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]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[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 block_len(&self) -> usize[src]

Returns the length of the current block.

All blocks have a length of NUM_DOCS_PER_BLOCK, except the last block that may have a length of any number between 1 and NUM_DOCS_PER_BLOCK - 1

pub fn seek(&mut self, target_doc: DocId)[src]

Position on a block that may contains target_doc.

If all docs are smaller than target, the block loaded may be empty, or be the last an incomplete VInt block.

pub fn advance(&mut self)[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 Clone for BlockSegmentPostings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

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

impl<T> Fruit for T where
    T: Send + Downcast
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,