pub struct CombinedFieldsQuery { /* private fields */ }
Expand description
The combined_fields query supports searching multiple text fields as if their contents had been indexed into one combined field. The query takes a term-centric view of the input string: first it analyzes the query string into individual terms, then looks for each term in any of the fields. This query is particularly useful when a match could span multiple text fields.
To create a combined fields query with:
Query::combined_fields(["title", "abstract", "body"], "database systems")
.boost(2)
.name("test");
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-combined-fields-query.html
Implementations§
Source§impl CombinedFieldsQuery
impl CombinedFieldsQuery
pub fn serialize<__S>(
__self: &CombinedFieldsQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
Source§impl CombinedFieldsQuery
impl CombinedFieldsQuery
Sourcepub fn auto_generate_synonyms_phrase_query(
self,
auto_generate_synonyms_phrase_query: bool,
) -> Self
pub fn auto_generate_synonyms_phrase_query( self, auto_generate_synonyms_phrase_query: bool, ) -> Self
If true
,
match phrase
queries are automatically created for multi-term synonyms. Defaults to true
.
See Use synonyms with match query for an example.
Sourcepub fn operator(self, operator: Operator) -> Self
pub fn operator(self, operator: Operator) -> Self
Boolean logic used to interpret text in the query
value
Sourcepub fn minimum_should_match<T>(self, minimum_should_match: T) -> Selfwhere
T: ToString,
pub fn minimum_should_match<T>(self, minimum_should_match: T) -> Selfwhere
T: ToString,
Minimum number of clauses that must match for a document to be returned. See the
minimum_should_match
parameter for valid values and more information.
Sourcepub fn zero_terms_query(self, zero_terms_query: ZeroTermsQuery) -> Self
pub fn zero_terms_query(self, zero_terms_query: ZeroTermsQuery) -> Self
Indicates whether no documents are returned if the analyzer
removes
all tokens, such as when using a stop
filter.
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 CombinedFieldsQuery
impl Clone for CombinedFieldsQuery
Source§fn clone(&self) -> CombinedFieldsQuery
fn clone(&self) -> CombinedFieldsQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more