Skip to content

Commit

Permalink
allow warming up of the full posting list (#1673)
Browse files Browse the repository at this point in the history
* allow warming up of the full posting list

* cargo fmt
  • Loading branch information
trinity-1686a authored Nov 14, 2022
1 parent 55a9d80 commit 5765c26
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/inverted_index_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ impl InvertedIndexReader {
Ok(())
}

/// Read the block postings for all terms.
/// This method is for an advanced usage only.
///
/// If you know which terms to pre-load, prefer using [`Self::warm_postings`] instead.
pub async fn warm_postings_full(&self, with_positions: bool) -> crate::AsyncIoResult<()> {
self.postings_file_slice.read_bytes_async().await?;
if with_positions {
self.positions_file_slice.read_bytes_async().await?;
}
Ok(())
}

/// Returns the number of documents containing the term asynchronously.
pub async fn doc_freq_async(&self, term: &Term) -> crate::AsyncIoResult<u32> {
Ok(self
Expand Down

0 comments on commit 5765c26

Please sign in to comment.