Enum kite::query::Query
[−]
[src]
pub enum Query { All { score: f32, }, None, Term { field: FieldRef, term: Term, scorer: TermScorer, }, MultiTerm { field: FieldRef, term_selector: MultiTermSelector, scorer: TermScorer, }, Conjunction { queries: Vec<Query>, }, Disjunction { queries: Vec<Query>, }, DisjunctionMax { queries: Vec<Query>, }, Filter { query: Box<Query>, filter: Box<Query>, }, Exclude { query: Box<Query>, exclude: Box<Query>, }, }
Variants
All
Matches all documents, assigning the specified score to each one
Fields of All
score: f32 | The score to assign to each document |
None
Matches nothing
Term
Matches documents that contain the specified term in the specified field
Fields of Term
field: FieldRef | The field being searched |
term: Term | The term to search for |
scorer: TermScorer | The method of scoring each match |
MultiTerm
Matches documents by a multi term selector Used for prefix, fuzzy and regex queries
Fields of MultiTerm
field: FieldRef | The field being searched |
term_selector: MultiTermSelector | The term selector to use. All terms that match this selector will be searched |
scorer: TermScorer | The method of scoring each match. |
Conjunction
Joins two queries with an AND operator This intersects the results of the queries. The scores are combined by average
Fields of Conjunction
queries: Vec<Query> |
Disjunction
Joins two queries with an OR operator This unites the results of the queries. The scores are combined by average
Fields of Disjunction
queries: Vec<Query> |
DisjunctionMax
Joins two queries with an OR operator This unites the results of the queries. Unlike a regular Disjunction query, this takes the highest score of each query for a particular match
Fields of DisjunctionMax
queries: Vec<Query> |
Filter
Removes documents that do not match the "filter" query from the results Basically the same as a Conjunction query except that the "filter" query does not affect the score
Fields of Filter
query: Box<Query> | |
filter: Box<Query> |
Exclude
Removes documents that match the "exclude" query from the results
Fields of Exclude
query: Box<Query> | |
exclude: Box<Query> |
Methods
impl Query
[src]
fn all() -> Query
Creates a new All query
fn term(field: FieldRef, term: Term) -> Query
Creates a new Term query
fn filter(self, filter: Query) -> Query
Filters the query by another query Only documents that match the other query will remain in the results but the other query will not affect the score
fn exclude(self, exclude: Query) -> Query
Filters the query to exclude documents that match the other query
fn boost(self, boost: f32) -> Query
Multiplies the score of documents that match the query by the specified "boost" value