Struct elasticsearch_dsl::search::queries::term_level::TermsQuery
source · [−]pub struct TermsQuery { /* private fields */ }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");https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html
Implementations
sourceimpl TermsQuery
impl TermsQuery
sourcepub fn boost<T>(self, boost: T) -> Selfwhere
T: AsPrimitive<f32>,
pub fn boost<T>(self, boost: T) -> Selfwhere
T: AsPrimitive<f32>,
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.
Trait Implementations
sourceimpl Clone for TermsQuery
impl Clone for TermsQuery
sourcefn clone(&self) -> TermsQuery
fn clone(&self) -> TermsQuery
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for TermsQuery
impl Debug for TermsQuery
sourceimpl From<TermsQuery> for Option<Query>
impl From<TermsQuery> for Option<Query>
sourcefn from(q: TermsQuery) -> Self
fn from(q: TermsQuery) -> Self
Converts to this type from the input type.
sourceimpl From<TermsQuery> for Query
impl From<TermsQuery> for Query
sourcefn from(q: TermsQuery) -> Self
fn from(q: TermsQuery) -> Self
Converts to this type from the input type.
sourceimpl IntoIterator for TermsQuery
impl IntoIterator for TermsQuery
type Item = TermsQuery
type Item = TermsQuery
The type of the elements being iterated over.
type IntoIter = IntoIter<<TermsQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<TermsQuery as IntoIterator>::Item>
Which kind of iterator are we turning this into?
sourceimpl PartialEq<TermsQuery> for Query
impl PartialEq<TermsQuery> for Query
sourcefn eq(&self, other: &TermsQuery) -> bool
fn eq(&self, other: &TermsQuery) -> bool
sourceimpl PartialEq<TermsQuery> for TermsQuery
impl PartialEq<TermsQuery> for TermsQuery
sourcefn eq(&self, other: &TermsQuery) -> bool
fn eq(&self, other: &TermsQuery) -> bool
sourceimpl Serialize for TermsQuery
impl Serialize for TermsQuery
impl StructuralPartialEq for TermsQuery
Auto Trait Implementations
impl RefUnwindSafe for TermsQuery
impl Send for TermsQuery
impl Sync for TermsQuery
impl Unpin for TermsQuery
impl UnwindSafe for TermsQuery
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more