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§
Source§impl TermsSetQuery
impl TermsSetQuery
pub fn serialize<__S>(
__self: &TermsSetQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
Source§impl 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§
Source§impl Clone for TermsSetQuery
impl Clone for TermsSetQuery
Source§fn clone(&self) -> TermsSetQuery
fn clone(&self) -> TermsSetQuery
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TermsSetQuery
impl Debug for TermsSetQuery
Source§impl From<TermsSetQuery> for Option<Query>
impl From<TermsSetQuery> for Option<Query>
Source§fn from(q: TermsSetQuery) -> Self
fn from(q: TermsSetQuery) -> Self
Converts to this type from the input type.
Source§impl From<TermsSetQuery> for Query
impl From<TermsSetQuery> for Query
Source§fn from(q: TermsSetQuery) -> Self
fn from(q: TermsSetQuery) -> Self
Converts to this type from the input type.
Source§impl IntoIterator for TermsSetQuery
impl IntoIterator for TermsSetQuery
Source§impl PartialEq<Query> for TermsSetQuery
impl PartialEq<Query> for TermsSetQuery
Source§impl PartialEq<TermsSetQuery> for Query
impl PartialEq<TermsSetQuery> for Query
Source§impl PartialEq for TermsSetQuery
impl PartialEq for TermsSetQuery
Source§impl Serialize for TermsSetQuery
impl Serialize for TermsSetQuery
impl StructuralPartialEq for TermsSetQuery
Auto Trait Implementations§
impl Freeze for TermsSetQuery
impl RefUnwindSafe for TermsSetQuery
impl Send for TermsSetQuery
impl Sync for TermsSetQuery
impl Unpin for TermsSetQuery
impl UnwindSafe for TermsSetQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more