Struct elasticsearch_dsl::search::queries::term_level::TermsQuery [−][src]
pub struct TermsQuery<T: Terms> { /* fields omitted */ }Expand description
Returns documents that contain one or more exact terms in a provided field. The terms query is the same as the term query, except you can search for multiple values.
To create a terms query with numeric values:
Query::terms("test", vec![123]);To create a terms query with string values and optional fields:
Query::terms("test", vec!["username"])
.boost(2)
.name("test");To create a terms lookup query:
Query::terms_lookup("test", "index", "id", "path")
.routing("routing")
.boost(1.3)
.name("lookup");https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html
Implementations
Floating point number used to decrease or increase the
relevance scores
of a query. Defaults to 1.0.
You can use the boost parameter to adjust relevance scores for searches containing two or more queries.
Boost values are relative to the default value of 1.0.
A boost value between 0 and 1.0 decreases the relevance score.
A value greater than 1.0 increases the relevance score.
You can use named queries to track which queries matched
returned documents. If named queries are used, the response
includes a matched_queries property for each hit.
Custom routing value of the document from which to fetch term values. If a custom routing value was provided when the document was indexed, this parameter is required.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl<T> RefUnwindSafe for TermsQuery<T> where
T: RefUnwindSafe,
impl<T> Send for TermsQuery<T> where
T: Send,
impl<T> Sync for TermsQuery<T> where
T: Sync,
impl<T> Unpin for TermsQuery<T> where
T: Unpin,
impl<T> UnwindSafe for TermsQuery<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more