pub struct AsyncSegmentReader { /* private fields */ }Expand description
Async segment reader with lazy loading
- Term dictionary: only index loaded, blocks loaded on-demand
- Postings: loaded on-demand per term via HTTP range requests
- Document store: only index loaded, blocks loaded on-demand via HTTP range requests
Implementations§
Source§impl AsyncSegmentReader
impl AsyncSegmentReader
Sourcepub async fn open<D: Directory>(
dir: &D,
segment_id: SegmentId,
schema: Arc<Schema>,
doc_id_offset: DocId,
cache_blocks: usize,
) -> Result<Self>
pub async fn open<D: Directory>( dir: &D, segment_id: SegmentId, schema: Arc<Schema>, doc_id_offset: DocId, cache_blocks: usize, ) -> Result<Self>
Open a segment with lazy loading
pub fn meta(&self) -> &SegmentMeta
pub fn num_docs(&self) -> u32
Sourcepub fn avg_field_len(&self, field: Field) -> f32
pub fn avg_field_len(&self, field: Field) -> f32
Get average field length for BM25F scoring
pub fn doc_id_offset(&self) -> DocId
pub fn schema(&self) -> &Schema
Sourcepub fn term_dict_stats(&self) -> SSTableStats
pub fn term_dict_stats(&self) -> SSTableStats
Get term dictionary stats for debugging
Sourcepub async fn get_postings(
&self,
field: Field,
term: &[u8],
) -> Result<Option<BlockPostingList>>
pub async fn get_postings( &self, field: Field, term: &[u8], ) -> Result<Option<BlockPostingList>>
Get posting list for a term (async - loads on demand)
For small posting lists (1-3 docs), the data is inlined in the term dictionary and no additional I/O is needed. For larger lists, reads from .post file.
Sourcepub async fn doc(&self, local_doc_id: DocId) -> Result<Option<Document>>
pub async fn doc(&self, local_doc_id: DocId) -> Result<Option<Document>>
Get document by local doc_id (async - loads on demand)
Sourcepub async fn prefetch_terms(
&self,
field: Field,
start_term: &[u8],
end_term: &[u8],
) -> Result<()>
pub async fn prefetch_terms( &self, field: Field, start_term: &[u8], end_term: &[u8], ) -> Result<()>
Prefetch term dictionary blocks for a key range
Sourcepub fn store_has_dict(&self) -> bool
pub fn store_has_dict(&self) -> bool
Check if store uses dictionary compression (incompatible with raw merging)
Sourcepub fn store_raw_blocks(&self) -> Vec<RawStoreBlock>
pub fn store_raw_blocks(&self) -> Vec<RawStoreBlock>
Get raw store blocks for optimized merging
Sourcepub fn store_data_slice(&self) -> &LazyFileSlice
pub fn store_data_slice(&self) -> &LazyFileSlice
Get store data slice for raw block access
Auto Trait Implementations§
impl Freeze for AsyncSegmentReader
impl !RefUnwindSafe for AsyncSegmentReader
impl Send for AsyncSegmentReader
impl Sync for AsyncSegmentReader
impl Unpin for AsyncSegmentReader
impl !UnwindSafe for AsyncSegmentReader
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> 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 more