Struct tantivy::Searcher
[−]
[src]
pub struct Searcher { /* fields omitted */ }
Holds a list of SegmentReader
s ready for search.
It guarantees that the Segment
will not be removed before
the destruction of the Searcher
.
Methods
impl Searcher
[src]
pub fn doc(&self, doc_address: &DocAddress) -> Result<Document>
[src]
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
.
pub fn num_docs(&self) -> DocId
[src]
Returns the overall number of documents in the index.
pub fn doc_freq(&self, term: &Term) -> u32
[src]
Return the overall number of documents containing the given term.
pub fn segment_readers(&self) -> &[SegmentReader]
[src]
Return the list of segment readers
pub fn segment_reader(&self, segment_ord: u32) -> &SegmentReader
[src]
Returns the segment_reader associated with the given segment_ordinal
pub fn search<C: Collector>(
&self,
query: &Query,
collector: &mut C
) -> Result<TimerTree>
[src]
&self,
query: &Query,
collector: &mut C
) -> Result<TimerTree>
Runs a query on the segment readers wrapped by the searcher
pub fn field(&self, field: Field) -> FieldSearcher
[src]
Return the field searcher associated to a Field
.
Trait Implementations
impl From<Vec<SegmentReader>> for Searcher
[src]
fn from(segment_readers: Vec<SegmentReader>) -> Searcher
[src]
Performs the conversion.