Struct tantivy::query::TermQuery
[−]
[src]
pub struct TermQuery { /* fields omitted */ }
A Term query matches all of the documents containing a specific term.
The score associated is defined as
idf
* sqrt(term_freq
/ field norm
)
in which :
idf
- inverse document frequency.term_freq
- number of occurrences of the term in the fieldfield norm
- number of tokens in the field.
Methods
impl TermQuery
[src]
pub fn new(term: Term, segment_postings_options: IndexRecordOption) -> TermQuery
[src]
Creates a new term query.
pub fn specialized_weight(&self, searcher: &Searcher) -> TermWeight
[src]
Returns a weight object.
While .weight(...)
returns a boxed trait object,
this method return a specific implementation.
This is useful for optimization purpose.
Trait Implementations
impl Debug for TermQuery
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Query for TermQuery
[src]
fn as_any(&self) -> &Any
[src]
Used to make it possible to cast Box into a specific type. This is mostly useful for unit tests. Read more
fn weight(&self, searcher: &Searcher) -> Result<Box<Weight>>
[src]
Create the weight associated to a query. Read more
fn search(
&self,
searcher: &Searcher,
collector: &mut Collector
) -> Result<TimerTree>
[src]
&self,
searcher: &Searcher,
collector: &mut Collector
) -> Result<TimerTree>
Search works as follows : Read more