Struct elasticsearch_dsl::search::queries::term_level::TermsSetQuery
source · [−]pub struct TermsSetQuery { /* private fields */ }Expand description
Returns documents that contain an exact terms_set in a provided field.
You can use the terms_set query to find documents based on a precise value such as a price, a product ID, or a username.
To create a terms_set query with numeric field:
Query::terms_set("test", [123], "required_matches");To create a terms_set query with script:
Query::terms_set(
"test",
[123],
TermsSetScript::new("Math.min(params.num_terms_sets, doc['required_matches'].value)")
.params(serde_json::json!({"num_terms_sets": 2}))
);https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-set-query.html
Implementations
sourceimpl TermsSetQuery
impl TermsSetQuery
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 TermsSetQuery
impl Clone for TermsSetQuery
sourcefn clone(&self) -> TermsSetQuery
fn clone(&self) -> TermsSetQuery
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 TermsSetQuery
impl Debug for TermsSetQuery
sourceimpl From<TermsSetQuery> for Option<Query>
impl From<TermsSetQuery> for Option<Query>
sourcefn from(q: TermsSetQuery) -> Self
fn from(q: TermsSetQuery) -> Self
Converts to this type from the input type.
sourceimpl From<TermsSetQuery> for Query
impl From<TermsSetQuery> for Query
sourcefn from(q: TermsSetQuery) -> Self
fn from(q: TermsSetQuery) -> Self
Converts to this type from the input type.
sourceimpl IntoIterator for TermsSetQuery
impl IntoIterator for TermsSetQuery
type Item = TermsSetQuery
type Item = TermsSetQuery
The type of the elements being iterated over.
type IntoIter = IntoIter<<TermsSetQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<TermsSetQuery as IntoIterator>::Item>
Which kind of iterator are we turning this into?
sourceimpl PartialEq<TermsSetQuery> for Query
impl PartialEq<TermsSetQuery> for Query
sourcefn eq(&self, other: &TermsSetQuery) -> bool
fn eq(&self, other: &TermsSetQuery) -> bool
sourceimpl PartialEq<TermsSetQuery> for TermsSetQuery
impl PartialEq<TermsSetQuery> for TermsSetQuery
sourcefn eq(&self, other: &TermsSetQuery) -> bool
fn eq(&self, other: &TermsSetQuery) -> bool
sourceimpl Serialize for TermsSetQuery
impl Serialize for TermsSetQuery
impl StructuralPartialEq for TermsSetQuery
Auto Trait Implementations
impl RefUnwindSafe for TermsSetQuery
impl Send for TermsSetQuery
impl Sync for TermsSetQuery
impl Unpin for TermsSetQuery
impl UnwindSafe for TermsSetQuery
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