logo
pub struct Searcher { /* private fields */ }
Expand description

Holds a list of SegmentReaders ready for search.

It guarantees that the Segment will not be removed before the destruction of the Searcher.

Implementations

Returns the Index associated to the Searcher

SearcherGeneration which identifies the version of the snapshot held by this Searcher.

Fetches a document from tantivy’s store given a DocAddress.

The searcher uses the segment ordinal to route the the request to the right Segment.

Access the schema associated to the index of this searcher.

Returns the overall number of documents in the index.

Return the overall number of documents containing the given term.

Return the list of segment readers

Returns the segment_reader associated with the given segment_ord

Runs a query on the segment readers wrapped by the searcher.

Search works as follows :

First the weight object associated to the query is created.

Then, the query loops over the segments and for each segment :

  • setup the collector and informs it that the segment being processed has changed.
  • creates a SegmentCollector for collecting documents associated to the segment
  • creates a Scorer object associated for this segment
  • iterate through the matched documents and push them to the segment collector.

Finally, the Collector merges each of the child collectors into itself for result usability by the caller.

Same as search(...) but multithreaded.

The current implementation is rather naive : multithreading is by splitting search into as many task as there are segments.

It is powerless at making search faster if your index consists in one large segment.

Also, keep in my multithreading a single query on several threads will not improve your throughput. It can actually hurt it. It will however, decrease the average response time.

Summarize total space usage of this searcher.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

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

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.