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]
impl Searcher
pub fn index(&self) -> &Index
[src]
pub fn index(&self) -> &Index
Returns the Index
associated to the Searcher
pub fn doc(&self, doc_address: DocAddress) -> Result<Document>
[src]
pub fn doc(&self, doc_address: DocAddress) -> Result<Document>
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 schema(&self) -> &Schema
[src]
pub fn schema(&self) -> &Schema
Access the schema associated to the index of this searcher.
pub fn num_docs(&self) -> u64
[src]
pub fn num_docs(&self) -> u64
Returns the overall number of documents in the index.
pub fn doc_freq(&self, term: &Term) -> u64
[src]
pub fn doc_freq(&self, term: &Term) -> u64
Return the overall number of documents containing the given term.
pub fn segment_readers(&self) -> &[SegmentReader]
[src]
pub fn segment_readers(&self) -> &[SegmentReader]
Return the list of segment readers
pub fn segment_reader(&self, segment_ord: u32) -> &SegmentReader
[src]
pub fn segment_reader(&self, segment_ord: u32) -> &SegmentReader
Returns the segment_reader associated with the given segment_ordinal
pub fn search<C: Collector>(
&self,
query: &Query,
collector: &mut C
) -> Result<()>
[src]
pub fn search<C: Collector>(
&self,
query: &Query,
collector: &mut C
) -> Result<()>
Runs a query on the segment readers wrapped by the searcher
pub fn field(&self, field: Field) -> FieldSearcher
[src]
pub fn field(&self, field: Field) -> FieldSearcher
Return the field searcher associated to a Field
.