Struct tantivy::SegmentReader [−][src]
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
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 schema(&self) -> &Schema
[src]
Returns the schema of the index this segment belongs to.
pub fn num_deleted_docs(&self) -> DocId
[src]
Return the number of documents that have been deleted in the segment.
pub fn has_deletes(&self) -> bool
[src]
Returns true iff some of the documents of the segment have been deleted.
pub fn fast_fields(&self) -> &FastFieldReaders
[src]
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 get_fieldnorms_reader(&self, field: Field) -> Result<FieldNormReader>
[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.
They are simply stored as a fast field, serialized in
the .fieldnorm
file of the segment.
pub fn get_store_reader(&self) -> Result<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) -> Result<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.
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).
pub fn segment_id(&self) -> SegmentId
[src]
Returns the segment id
pub fn delete_bitset(&self) -> Option<&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.
pub fn doc_ids_alive(&self) -> impl Iterator<Item = DocId> + '_
[src]
Returns an iterator that will iterate over the alive document ids
pub fn space_usage(&self) -> Result<SegmentSpaceUsage>
[src]
Summarize total space usage of this segment.
Trait Implementations
impl Clone for SegmentReader
[src]
fn clone(&self) -> SegmentReader
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SegmentReader
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SegmentReader
[src]
impl Send for SegmentReader
[src]
impl Sync for SegmentReader
[src]
impl Unpin for SegmentReader
[src]
impl !UnwindSafe for SegmentReader
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> Fruit for T where
T: Send + Downcast,
[src]
T: Send + Downcast,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,