Skip to main content

Scorer

Trait Scorer 

Source
pub trait Scorer: Send {
    // Required methods
    fn doc(&self) -> DocId;
    fn score(&self) -> Score;
    fn advance(&mut self) -> DocId;
    fn seek(&mut self, target: DocId) -> DocId;
    fn size_hint(&self) -> u32;

    // Provided method
    fn matched_positions(&self) -> Option<MatchedPositions> { ... }
}
Expand description

Scorer that iterates over matching documents and computes scores

Required Methods§

Source

fn doc(&self) -> DocId

Current document ID, or TERMINATED if exhausted

Source

fn score(&self) -> Score

Score for current document

Source

fn advance(&mut self) -> DocId

Advance to next document

Source

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

Seek to first doc >= target

Source

fn size_hint(&self) -> u32

Size hint for remaining documents

Provided Methods§

Source

fn matched_positions(&self) -> Option<MatchedPositions>

Get matched positions for the current document (if available) Returns (field_id, positions) pairs where positions are encoded as per PositionMode

Implementors§