Struct tantivy::postings::SegmentPostings [−][src]
pub struct SegmentPostings { /* fields omitted */ }
SegmentPostings
represents the inverted list or postings associated to
a term in a Segment
.
As we iterate through the SegmentPostings
, the frequencies are optionally decoded.
Positions on the other hand, are optionally entirely decoded upfront.
Methods
impl SegmentPostings
[src]
impl SegmentPostings
pub fn empty() -> Self
[src]
pub fn empty() -> Self
Returns an empty segment postings object
pub fn create_from_docs(docs: &[u32]) -> SegmentPostings
[src]
pub fn create_from_docs(docs: &[u32]) -> SegmentPostings
Creates a segment postings object with the given documents and no frequency encoded.
This method is mostly useful for unit tests.
It serializes the doc ids using tantivy's codec
and returns a SegmentPostings
object that embeds a
buffer with the serialized data.
impl SegmentPostings
[src]
impl SegmentPostings
pub fn from_block_postings(
segment_block_postings: BlockSegmentPostings,
positions_stream_opt: Option<CompressedIntStream>
) -> SegmentPostings
[src]
pub fn from_block_postings(
segment_block_postings: BlockSegmentPostings,
positions_stream_opt: Option<CompressedIntStream>
) -> SegmentPostings
Reads a Segment postings from an &u8
len
- number of document in the posting lists.data
- data array. The complete data is not necessarily used.freq_handler
- the freq handler is in charge of decoding frequencies and/or positions
Trait Implementations
impl DocSet for SegmentPostings
[src]
impl DocSet for SegmentPostings
fn skip_next(&mut self, target: DocId) -> SkipResult
[src]
fn skip_next(&mut self, target: DocId) -> SkipResult
After skipping, position the iterator in such a way that .doc()
will return a value greater than or equal to target. Read more
fn advance(&mut self) -> bool
[src]
fn advance(&mut self) -> bool
Goes to the next element. .advance(...)
needs to be called a first time to point to the correct element. Read more
fn size_hint(&self) -> u32
[src]
fn size_hint(&self) -> u32
Returns a best-effort hint of the length of the docset. Read more
fn doc(&self) -> DocId
[src]
fn doc(&self) -> DocId
Return the current document's DocId
.
fn append_to_bitset(&mut self, bitset: &mut BitSet)
[src]
fn append_to_bitset(&mut self, bitset: &mut BitSet)
Appends all docs to a bitset
.
fn fill_buffer(&mut self, buffer: &mut [DocId]) -> usize
[src]
fn fill_buffer(&mut self, buffer: &mut [DocId]) -> usize
Fills a given mutable buffer with the next doc ids from the DocSet
Read more
fn count(&mut self) -> u32
[src]
fn count(&mut self) -> u32
Returns the number documents matching. Read more
impl HasLen for SegmentPostings
[src]
impl HasLen for SegmentPostings
impl Postings for SegmentPostings
[src]
impl Postings for SegmentPostings
fn term_freq(&self) -> u32
[src]
fn term_freq(&self) -> u32
Returns the term frequency
fn positions_with_offset(&mut self, offset: u32, output: &mut Vec<u32>)
[src]
fn positions_with_offset(&mut self, offset: u32, output: &mut Vec<u32>)
Returns the positions offseted with a given value. The output vector will be resized to the term_freq
. Read more
fn positions(&mut self, output: &mut Vec<u32>)
[src]
fn positions(&mut self, output: &mut Vec<u32>)
Returns the positions of the term in the given document. The output vector will be resized to the term_freq
. Read more
Auto Trait Implementations
impl Send for SegmentPostings
impl Send for SegmentPostings
impl Sync for SegmentPostings
impl Sync for SegmentPostings