[−][src]Struct tantivy::InvertedIndexReader
The inverted index reader is in charge of accessing the inverted index associated to a specific field.
Note
It is safe to delete the segment associated to
an InvertedIndexReader
. As long as it is open,
the ReadOnlySource
it is relying on should
stay available.
InvertedIndexReader
are created by calling
the SegmentReader
's [.inverted_index(...)
] method
Methods
impl InvertedIndexReader
[src]
pub fn empty(field_type: &FieldType) -> InvertedIndexReader
[src]
Creates an empty InvertedIndexReader
object, which
contains no terms at all.
pub fn get_term_info(&self, term: &Term) -> Option<TermInfo>
[src]
Returns the term info associated with the term.
pub fn terms(&self) -> &TermDictionary
[src]
Return the term dictionary datastructure.
pub fn reset_block_postings_from_terminfo(
&self,
term_info: &TermInfo,
block_postings: &mut BlockSegmentPostings
)
[src]
&self,
term_info: &TermInfo,
block_postings: &mut BlockSegmentPostings
)
Resets the block segment to another position of the postings file.
This is useful for enumerating through a list of terms,
and consuming the associated posting lists while avoiding
reallocating a BlockSegmentPostings
.
Warning
This does not reset the positions list.
pub fn read_block_postings(
&self,
term: &Term,
option: IndexRecordOption
) -> Option<BlockSegmentPostings>
[src]
&self,
term: &Term,
option: IndexRecordOption
) -> Option<BlockSegmentPostings>
Returns a block postings given a Term
.
This method is for an advanced usage only.
Most user should prefer using read_postings
instead.
pub fn read_block_postings_from_terminfo(
&self,
term_info: &TermInfo,
requested_option: IndexRecordOption
) -> BlockSegmentPostings
[src]
&self,
term_info: &TermInfo,
requested_option: IndexRecordOption
) -> BlockSegmentPostings
Returns a block postings given a term_info
.
This method is for an advanced usage only.
Most user should prefer using read_postings
instead.
pub fn read_postings_from_terminfo(
&self,
term_info: &TermInfo,
option: IndexRecordOption
) -> SegmentPostings
[src]
&self,
term_info: &TermInfo,
option: IndexRecordOption
) -> SegmentPostings
Returns a posting object given a term_info
.
This method is for an advanced usage only.
Most user should prefer using read_postings
instead.
pub fn total_num_tokens(&self) -> u64
[src]
Returns the total number of tokens recorded for all documents (including deleted documents).
pub fn read_postings(
&self,
term: &Term,
option: IndexRecordOption
) -> Option<SegmentPostings>
[src]
&self,
term: &Term,
option: IndexRecordOption
) -> Option<SegmentPostings>
Returns the segment postings associated with the term, and with the given option,
or None
if the term has never been encountered and indexed.
If the field was not indexed with the indexing options that cover
the requested options, the returned SegmentPostings
the method does not fail
and returns a SegmentPostings
with as much information as possible.
For instance, requesting IndexRecordOption::Freq
for a
TextIndexingOptions
that does not index position will return a SegmentPostings
with DocId
s and frequencies.
pub fn doc_freq(&self, term: &Term) -> u32
[src]
Returns the number of documents containing the term.
Auto Trait Implementations
impl Sync for InvertedIndexReader
impl Send for InvertedIndexReader
impl Unpin for InvertedIndexReader
impl !UnwindSafe for InvertedIndexReader
impl !RefUnwindSafe for InvertedIndexReader
Blanket Implementations
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> From<T> for 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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,