pub struct SegmentBuilder { /* private fields */ }Expand description
Builder for creating a single segment
Implementations§
Source§impl SegmentBuilder
impl SegmentBuilder
pub fn new(schema: Schema) -> Self
Sourcepub fn with_wand_data(schema: Schema, wand_data: Arc<WandData>) -> Self
pub fn with_wand_data(schema: Schema, wand_data: Arc<WandData>) -> Self
Create a new segment builder with pre-computed WAND data
The WAND data provides IDF values for terms, enabling more accurate
block-max scores during indexing. This is useful when you have
pre-computed term statistics from hermes-tool term-stats.
Sourcepub fn set_wand_data(&mut self, wand_data: Arc<WandData>)
pub fn set_wand_data(&mut self, wand_data: Arc<WandData>)
Set WAND data for IDF computation
pub fn set_tokenizer(&mut self, field: Field, tokenizer: BoxedTokenizer)
pub fn num_docs(&self) -> u32
pub fn add_document(&mut self, doc: Document) -> Result<DocId>
pub async fn build<D: Directory + DirectoryWriter>( &self, dir: &D, segment_id: SegmentId, ) -> Result<SegmentMeta>
Sourcepub async fn build_with_threads<D: Directory + DirectoryWriter>(
&self,
dir: &D,
segment_id: SegmentId,
num_threads: usize,
) -> Result<SegmentMeta>
pub async fn build_with_threads<D: Directory + DirectoryWriter>( &self, dir: &D, segment_id: SegmentId, num_threads: usize, ) -> Result<SegmentMeta>
Build segment with parallel compression
Uses num_threads for parallel block compression in the document store.
Auto Trait Implementations§
impl Freeze for SegmentBuilder
impl !RefUnwindSafe for SegmentBuilder
impl Send for SegmentBuilder
impl Sync for SegmentBuilder
impl Unpin for SegmentBuilder
impl !UnwindSafe for SegmentBuilder
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