Struct tantivy::IndexReaderBuilder
source · pub struct IndexReaderBuilder { /* private fields */ }
Expand description
IndexReader
builder
It makes it possible to configure:
ReloadPolicy
defining when new index versions are detectedWarmer
implementations- number of warming threads, for parallelizing warming work
- The cache size of the underlying doc store readers.
Implementations§
source§impl IndexReaderBuilder
impl IndexReaderBuilder
sourcepub fn try_into(self) -> Result<IndexReader>
pub fn try_into(self) -> Result<IndexReader>
Builds the reader.
Building the reader is a non-trivial operation that requires to open different segment readers. It may take hundreds of milliseconds of time and it may return an error.
sourcepub fn reload_policy(self, reload_policy: ReloadPolicy) -> IndexReaderBuilder
pub fn reload_policy(self, reload_policy: ReloadPolicy) -> IndexReaderBuilder
Sets the reload_policy.
See ReloadPolicy
for more details.
sourcepub fn doc_store_cache_num_blocks(
self,
doc_store_cache_num_blocks: usize
) -> IndexReaderBuilder
pub fn doc_store_cache_num_blocks( self, doc_store_cache_num_blocks: usize ) -> IndexReaderBuilder
Sets the cache size of the doc store readers.
The doc store readers cache by default DOCSTORE_CACHE_CAPACITY(100) decompressed blocks.
sourcepub fn warmers(self, warmers: Vec<Weak<dyn Warmer>>) -> IndexReaderBuilder
pub fn warmers(self, warmers: Vec<Weak<dyn Warmer>>) -> IndexReaderBuilder
Set the Warmer
s that are invoked when reloading searchable segments.
sourcepub fn num_warming_threads(
self,
num_warming_threads: usize
) -> IndexReaderBuilder
pub fn num_warming_threads( self, num_warming_threads: usize ) -> IndexReaderBuilder
Sets the number of warming threads.
This allows parallelizing warming work when there are multiple Warmer
registered with
the IndexReader
.
Trait Implementations§
source§impl Clone for IndexReaderBuilder
impl Clone for IndexReaderBuilder
source§fn clone(&self) -> IndexReaderBuilder
fn clone(&self) -> IndexReaderBuilder
Returns a copy 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 TryInto<IndexReader> for IndexReaderBuilder
impl TryInto<IndexReader> for IndexReaderBuilder
§type Error = TantivyError
type Error = TantivyError
The type returned in the event of a conversion error.
source§fn try_into(self) -> Result<IndexReader>
fn try_into(self) -> Result<IndexReader>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for IndexReaderBuilder
impl !RefUnwindSafe for IndexReaderBuilder
impl Send for IndexReaderBuilder
impl Sync for IndexReaderBuilder
impl Unpin for IndexReaderBuilder
impl !UnwindSafe for IndexReaderBuilder
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.