Skip to main content

Collector

Trait Collector 

Source
pub trait Collector {
    // Required method
    fn collect(
        &mut self,
        doc_id: DocId,
        score: Score,
        positions: &[(u32, Vec<ScoredPosition>)],
    );

    // Provided method
    fn needs_positions(&self) -> bool { ... }
}
Expand description

Trait for search result collectors

Implement this trait to create custom collectors that can be combined and passed to query execution.

Required Methods§

Source

fn collect( &mut self, doc_id: DocId, score: Score, positions: &[(u32, Vec<ScoredPosition>)], )

Called for each matching document positions: Vec of (field_id, scored_positions)

Provided Methods§

Source

fn needs_positions(&self) -> bool

Whether this collector needs position information

Implementations on Foreign Types§

Source§

impl<A: Collector, B: Collector> Collector for (&mut A, &mut B)

Source§

fn collect( &mut self, doc_id: DocId, score: Score, positions: &[(u32, Vec<ScoredPosition>)], )

Source§

fn needs_positions(&self) -> bool

Source§

impl<A: Collector, B: Collector, C: Collector> Collector for (&mut A, &mut B, &mut C)

Source§

fn collect( &mut self, doc_id: DocId, score: Score, positions: &[(u32, Vec<ScoredPosition>)], )

Source§

fn needs_positions(&self) -> bool

Implementors§