Struct tantivy::Searcher [−][src]
pub struct Searcher { /* fields omitted */ }
Expand description
Holds a list of SegmentReader
s ready for search.
It guarantees that the Segment
will not be removed before
the destruction of the Searcher
.
Implementations
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
.
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_ordinal
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
Auto Trait Implementations
impl !RefUnwindSafe for Searcher
impl !UnwindSafe for Searcher
Blanket Implementations
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
pub fn vzip(self) -> V