Trait tantivy::collector::Collector [] [src]

pub trait Collector {
    fn set_segment(
        &mut self,
        segment_local_id: SegmentLocalId,
        segment: &SegmentReader
    ) -> Result<()>;
fn collect(&mut self, doc: DocId, score: Score); }

Collectors are in charge of collecting and retaining relevant information from the document found and scored by the query.

For instance,

Queries are in charge of pushing the DocSet to the collector.

As they work on multiple segments, they first inform the collector of a change in a segment and then call the collect method to push the document to the collector.

Temporally, our collector will receive calls

Segments are not guaranteed to be visited in any specific order.

Required Methods

set_segment is called before beginning to enumerate on this segment.

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

Implementations on Foreign Types

impl<'a, C: Collector> Collector for &'a mut C
[src]

[src]

[src]

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

Implementors