Struct summa_core::components::IndexWriterHolder
source · pub struct IndexWriterHolder { /* private fields */ }Expand description
Managing write operations to index
Implementations§
source§impl IndexWriterHolder
impl IndexWriterHolder
sourcepub fn create(
index: &Index,
writer_threads: WriterThreads,
writer_heap_size_bytes: usize,
merge_policy: Arc<dyn MergePolicy>
) -> SummaResult<IndexWriterHolder>
pub fn create( index: &Index, writer_threads: WriterThreads, writer_heap_size_bytes: usize, merge_policy: Arc<dyn MergePolicy> ) -> SummaResult<IndexWriterHolder>
Creates new IndexWriterHolder from Index and core::Config
sourcepub fn index_document(
&self,
document: TantivyDocument,
conflict_strategy: ConflictStrategy
) -> SummaResult<()>
pub fn index_document( &self, document: TantivyDocument, conflict_strategy: ConflictStrategy ) -> SummaResult<()>
Put document to the index. Before comes searchable it must be committed
sourcepub fn merge(
&self,
segment_ids: &[SegmentId],
segment_attributes: Option<SummaSegmentAttributes>
) -> SummaResult<Option<SegmentMeta>>
pub fn merge( &self, segment_ids: &[SegmentId], segment_attributes: Option<SummaSegmentAttributes> ) -> SummaResult<Option<SegmentMeta>>
Merge segments into one.
Also cleans deleted documents and do recompression. Possible to pass the only segment in segment_ids to do recompression or clean up.
It is heavy operation that also blocks on .await so should be spawned if non-blocking behaviour is required
sourcepub fn commit(&mut self) -> SummaResult<Opstamp>
pub fn commit(&mut self) -> SummaResult<Opstamp>
Commits already indexed documents
Committing makes indexed documents visible
It is heavy operation that also blocks on .await so should be spawned if non-blocking behaviour is required
pub fn rollback(&mut self) -> SummaResult<()>
pub fn vacuum( &self, segment_attributes: Option<SummaSegmentAttributes>, excluded_segments: Vec<String> ) -> SummaResult<()>
pub fn wait_merging_threads(&mut self)
sourcepub fn commit_and_prepare(
&mut self,
with_hotcache: bool
) -> SummaResult<Opstamp>
pub fn commit_and_prepare( &mut self, with_hotcache: bool ) -> SummaResult<Opstamp>
Locking index files for executing operation on them
Auto Trait Implementations§
impl !RefUnwindSafe for IndexWriterHolder
impl Send for IndexWriterHolder
impl Sync for IndexWriterHolder
impl Unpin for IndexWriterHolder
impl !UnwindSafe for IndexWriterHolder
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.