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
sourceimpl 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_size(
self,
doc_store_cache_size: usize
) -> IndexReaderBuilder
pub fn doc_store_cache_size(
self,
doc_store_cache_size: 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
sourceimpl Clone for IndexReaderBuilder
impl Clone for IndexReaderBuilder
sourcefn clone(&self) -> IndexReaderBuilder
fn clone(&self) -> IndexReaderBuilder
Returns a copy of the value. Read more
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl 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.
sourcefn try_into(self) -> Result<IndexReader>
fn try_into(self) -> Result<IndexReader>
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for IndexReaderBuilder
impl Send for IndexReaderBuilder
impl Sync for IndexReaderBuilder
impl Unpin for IndexReaderBuilder
impl !UnwindSafe for IndexReaderBuilder
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn 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. Read moresourcefn 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. Read moresourceimpl<T> DowncastSync for Twhere
T: Any + Send + Sync,
impl<T> DowncastSync for Twhere
T: Any + Send + Sync,
sourcefn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>
Convert
Arc<Trait>
(where Trait: Downcast
) to Arc<Any>
. Arc<Any>
can then be
further downcast
into Arc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourceimpl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more