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]
pub fn max_doc(&self) -> DocId
[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.
pub fn num_docs(&self) -> DocId
[src]
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.
pub fn num_deleted_docs(&self) -> DocId
[src]
Return the number of documents that have been deleted in the segment.
pub fn get_fast_field_reader<TFastFieldReader: FastFieldReader>(
&self,
field: Field
) -> Result<TFastFieldReader>
[src]
&self,
field: Field
) -> Result<TFastFieldReader>
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.
pub fn facet_reader(&self, field: Field) -> Result<FacetReader>
[src]
Accessor to the FacetReader
associated to a given Field
.
pub fn multi_value_reader(
&self,
field: Field
) -> Result<MultiValueIntFastFieldReader>
[src]
&self,
field: Field
) -> Result<MultiValueIntFastFieldReader>
Accessor to the MultiValueIntFastFieldReader
associated to a given Field
.
pub fn get_fieldnorms_reader(&self, field: Field) -> Option<U64FastFieldReader>
[src]
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.
pub fn get_store_reader(&self) -> &StoreReader
[src]
Accessor to the segment's StoreReader
.
pub fn open(segment: &Segment) -> Result<SegmentReader>
[src]
Open a new segment for reading.
pub fn inverted_index(&self, field: Field) -> Arc<InvertedIndexReader>
[src]
Returns a field reader associated to the field given in argument.
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.
pub fn doc(&self, doc_id: DocId) -> Result<Document>
[src]
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.
pub fn segment_id(&self) -> SegmentId
[src]
Returns the segment id
pub fn delete_bitset(&self) -> &DeleteBitSet
[src]
Returns the bitset representing the documents that have been deleted.
pub fn is_deleted(&self, doc: DocId) -> bool
[src]
Returns true iff the doc
is marked
as deleted.
Trait Implementations
impl Clone for SegmentReader
[src]
fn clone(&self) -> SegmentReader
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more