Struct tantivy::IndexReaderBuilder
source · [−]pub struct IndexReaderBuilder { /* private fields */ }
Expand description
IndexReader builder
It makes it possible to configure:
- Searcher pool size
- ReloadPolicy defining when new index versions are detected
- Warmer implementations
- number of warming threads, for parallelizing warming work
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 num_searchers(self, num_searchers: usize) -> IndexReaderBuilder
pub fn num_searchers(self, num_searchers: usize) -> IndexReaderBuilder
Sets the number of Searcher to pool.
sourcepub fn warmers(self, warmers: Vec<Weak<dyn Warmer>>) -> IndexReaderBuilder
pub fn warmers(self, warmers: Vec<Weak<dyn Warmer>>) -> IndexReaderBuilder
Set the Warmers 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.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn 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 T where
T: Any,
impl<T> Downcast for T where
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 more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more