logo
pub struct SegmentReader { /* private fields */ }
Expand description

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.

Implementations

Returns the highest document id ever attributed in this segment + 1.

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

Returns the schema of the index this segment belongs to.

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

Returns true if 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 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.

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.

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.

If the field is marked as index, a warn is logged and an empty InvertedIndexReader is returned. Similarly if the field is marked as indexed but no term has been indexed for the given index. an empty InvertedIndexReader is returned (but no warning is logged).

Returns the segment id

Returns the delete opstamp

Returns the bitset representing the documents that have been deleted.

Returns true if the doc is marked as deleted.

Returns an iterator that will iterate over the alive document ids

Summarize total space usage of this segment.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.