Struct tantivy::SegmentReader [] [src]

pub struct SegmentReader { /* fields omitted */ }

Entry point to access all of the datastructures of the Segment

  • term dictionary
  • postings
  • store
  • fast field readers
  • field norm reader

The segment reader has a very low memory footprint, as close to all of the memory data is mmapped.

Methods

impl SegmentReader
[src]

Returns the highest document id ever attributed in this segment + 1. Today, tantivy does not handle deletes, so it happens to also be the number of documents in the index.

Returns the number of documents. Deleted documents are not counted.

Today, tantivy does not handle deletes so max doc and num_docs are the same.

Accessor to a segment's fast field reader given a field.

Accessor to the segment's Field norms's reader.

Field norms are the length (in tokens) of the fields. It is used in the computation of the TfIdf.

They are simply stored as a fast field, serialized in the .fieldnorm file of the segment.

Returns the number of documents containing the term.

Accessor to the segment's StoreReader.

Open a new segment for reading.

Return the term dictionary datastructure.

Returns the document (or to be accurate, its stored field) bearing the given doc id. This method is slow and should seldom be called from within a collector.

Returns the segment postings associated with the term, and with the given option, or None if the term has never been encounterred and indexed.

If the field was not indexed with the indexing options that cover the requested options, the returned SegmentPostings the method does not fail and returns a SegmentPostings with as much information as possible.

For instance, requesting SegmentPostingsOption::FreqAndPositions for a TextIndexingOptions that does not index position will return a SegmentPostings with DocIds and frequencies.

Returns the posting list associated with a term.

Returns the term info associated with the term.

Trait Implementations

impl Debug for SegmentReader
[src]

Formats the value using the given formatter.