Struct tantivy::SegmentReader [−][src]
pub struct SegmentReader { /* fields omitted */ }
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.
TODO fix not decoding docfreq
Implementations
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.
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 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.
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 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
Summarize total space usage of this segment.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SegmentReader
impl Send for SegmentReader
impl Sync for SegmentReader
impl Unpin for SegmentReader
impl !UnwindSafe for SegmentReader
Blanket Implementations
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
pub fn vzip(self) -> V