[][src]Trait tantivy::collector::SegmentCollector

pub trait SegmentCollector: 'static {
    type Fruit: Fruit;
    fn collect(&mut self, doc: DocId, score: Score);
fn harvest(self) -> Self::Fruit; }

The SegmentCollector is the trait in charge of defining the collect operation at the scale of the segment.

.collect(doc, score) will be called for every documents matching the query.

Associated Types

type Fruit: Fruit

Fruit is the type for the result of our collection. e.g. usize for the Count collector.

Loading content...

Required methods

fn collect(&mut self, doc: DocId, score: Score)

The query pushes the scored document to the collector via this method.

fn harvest(self) -> Self::Fruit

Extract the fruit of the collection from the SegmentCollector.

Loading content...

Implementations on Foreign Types

impl SegmentCollector for Box<dyn BoxableSegmentCollector>[src]

type Fruit = Box<dyn Fruit>

impl<Left, Right> SegmentCollector for (Left, Right) where
    Left: SegmentCollector,
    Right: SegmentCollector
[src]

type Fruit = (Left::Fruit, Right::Fruit)

impl<One, Two, Three> SegmentCollector for (One, Two, Three) where
    One: SegmentCollector,
    Two: SegmentCollector,
    Three: SegmentCollector
[src]

type Fruit = (One::Fruit, Two::Fruit, Three::Fruit)

impl<One, Two, Three, Four> SegmentCollector for (One, Two, Three, Four) where
    One: SegmentCollector,
    Two: SegmentCollector,
    Three: SegmentCollector,
    Four: SegmentCollector
[src]

type Fruit = (One::Fruit, Two::Fruit, Three::Fruit, Four::Fruit)

Loading content...

Implementors

Loading content...