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.

TODO fix not decoding docfreq

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.

Returns the schema of the index this segment belongs to.

Return the number of documents that have been deleted in the segment.

Returns true iff some of the documents of the segment have been deleted.

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

Returns the u64 fast value reader if the field is a u64 field indexed as "fast".

Return a FastFieldNotAvailableError if the field is not declared as a fast field in the schema.

Panics

May panic if the index is corrupted.

Accessor to the MultiValueIntFastFieldReader associated to a given Field. May panick if the field is not a multivalued fastfield of the type Item.

Accessor to the BytesFastFieldReader associated to a given Field.

Accessor to the FacetReader associated to a given 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] (https://fulmicoton.gitbooks.io/tantivy-doc/content/tfidf.html).

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

Accessor to the segment's StoreReader.

Open a new segment for reading.

Returns a field reader associated to the field given in argument. If the field was not present in the index during indexing time, the InvertedIndexReader is empty.

The field reader is in charge of iterating through the term dictionary associated to a specific field, and opening the posting list associated to any term.

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 id

Returns the bitset representing the documents that have been deleted.

Returns true iff the doc is marked as deleted.

Returns an iterator that will iterate over the alive document ids

Trait Implementations

impl Clone for SegmentReader
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for SegmentReader
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations