Skip to main content

ScoringIterator

Trait ScoringIterator 

Source
pub trait ScoringIterator {
    // Required methods
    fn doc(&self) -> DocId;
    fn advance(&mut self) -> DocId;
    fn seek(&mut self, target: DocId) -> DocId;
    fn score(&self) -> f32;
    fn max_score(&self) -> f32;
    fn current_block_max_score(&self) -> f32;

    // Provided methods
    fn is_exhausted(&self) -> bool { ... }
    fn skip_to_next_block(&mut self) -> DocId { ... }
}
Expand description

Common interface for scoring iterators (text terms or sparse dimensions)

Abstracts the common operations needed for WAND-style top-k retrieval.

Required Methods§

Source

fn doc(&self) -> DocId

Current document ID (u32::MAX if exhausted)

Source

fn advance(&mut self) -> DocId

Advance to next document, returns new doc ID

Source

fn seek(&mut self, target: DocId) -> DocId

Seek to first document >= target, returns new doc ID

Source

fn score(&self) -> f32

Score contribution for current document

Source

fn max_score(&self) -> f32

Maximum possible score for this term/dimension (global upper bound)

Source

fn current_block_max_score(&self) -> f32

Current block’s maximum score upper bound (for block-level pruning)

Provided Methods§

Source

fn is_exhausted(&self) -> bool

Check if iterator is exhausted

Source

fn skip_to_next_block(&mut self) -> DocId

Skip to the next block, returning the first doc_id in the new block. Used for block-max WAND optimization when current block can’t beat threshold. Default implementation just advances (no block-level skipping).

Implementors§