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]
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 fast_field_reader<Item: FastValue>(
&self,
field: Field
) -> Result<FastFieldReader<Item>>
[src]
&self,
field: Field
) -> Result<FastFieldReader<Item>>
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 multi_fast_field_reader<Item: FastValue>(
&self,
field: Field
) -> Result<MultiValueIntFastFieldReader<Item>>
[src]
&self,
field: Field
) -> Result<MultiValueIntFastFieldReader<Item>>
Accessor to the MultiValueIntFastFieldReader
associated to a given Field
.
May panick if the field is not a multivalued fastfield of the type Item
.
pub fn facet_reader(&self, field: Field) -> Result<FacetReader>
[src]
Accessor to the FacetReader
associated to a given Field
.
pub fn get_fieldnorms_reader(
&self,
field: Field
) -> Option<FastFieldReader<u64>>
[src]
&self,
field: Field
) -> Option<FastFieldReader<u64>>
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. 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.
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