pub struct PositionPostingList { /* private fields */ }Expand description
Block-based position posting list with skip list for O(log n) doc_id lookup
Similar to BlockPostingList but stores positions per document. Uses binary search on skip list to find the right block, then linear scan within block.
Implementations§
Source§impl PositionPostingList
impl PositionPostingList
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn from_postings(postings: &[PostingWithPositions]) -> Result<Self>
pub fn from_postings(postings: &[PostingWithPositions]) -> Result<Self>
Build from a list of postings with positions
Sourcepub fn push(&mut self, doc_id: DocId, positions: Vec<u32>)
pub fn push(&mut self, doc_id: DocId, positions: Vec<u32>)
Add a posting with positions (for building - converts to block format on serialize)
pub fn doc_count(&self) -> u32
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get_positions(&self, target_doc_id: DocId) -> Option<Vec<u32>>
pub fn get_positions(&self, target_doc_id: DocId) -> Option<Vec<u32>>
Get positions for a specific document using binary search on skip list
Sourcepub fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>
Serialize to bytes with block format
Sourcepub fn deserialize<R: Read>(reader: &mut R) -> Result<Self>
pub fn deserialize<R: Read>(reader: &mut R) -> Result<Self>
Deserialize from bytes
Sourcepub fn concatenate_blocks(
sources: &[(PositionPostingList, u32)],
) -> Result<Self>
pub fn concatenate_blocks( sources: &[(PositionPostingList, u32)], ) -> Result<Self>
Concatenate blocks from multiple position lists with doc_id remapping (for merge)
Sourcepub fn iter(&self) -> PositionPostingIterator<'_>
pub fn iter(&self) -> PositionPostingIterator<'_>
Get iterator over all postings (for phrase queries)
Trait Implementations§
Source§impl Clone for PositionPostingList
impl Clone for PositionPostingList
Source§fn clone(&self) -> PositionPostingList
fn clone(&self) -> PositionPostingList
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PositionPostingList
impl Debug for PositionPostingList
Auto Trait Implementations§
impl Freeze for PositionPostingList
impl RefUnwindSafe for PositionPostingList
impl Send for PositionPostingList
impl Sync for PositionPostingList
impl Unpin for PositionPostingList
impl UnwindSafe for PositionPostingList
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.