Struct elasticsearch_dsl::search::queries::full_text::MatchPhraseQuery
source · pub struct MatchPhraseQuery { /* private fields */ }
Expand description
The match_phrase
query analyzes the text and creates a phrase query out
of the analyzed text.
To create a MatchPhrase query:
Query::match_phrase("test", "search text")
.boost(2)
.name("test");
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html
Implementations§
source§impl MatchPhraseQuery
impl MatchPhraseQuery
pub fn serialize<__S>( __self: &MatchPhraseQuery, __serializer: __S ) -> Result<__S::Ok, __S::Error>where __S: Serializer,
source§impl MatchPhraseQuery
impl MatchPhraseQuery
sourcepub fn analyzer<T>(self, analyzer: T) -> Selfwhere
T: ToString,
pub fn analyzer<T>(self, analyzer: T) -> Selfwhere T: ToString,
Analyzer
used to convert the text in the query
value into tokens. Defaults to the
index-time analyzer
mapped for the <field>
. If no analyzer is mapped, the index’s default analyzer is used.
sourcepub fn slop(self, slop: u8) -> Self
pub fn slop(self, slop: u8) -> Self
The maximum number of intervening unmatched positions, as well as whether matches are required to be in-order.
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 MatchPhraseQuery
impl Clone for MatchPhraseQuery
source§fn clone(&self) -> MatchPhraseQuery
fn clone(&self) -> MatchPhraseQuery
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MatchPhraseQuery
impl Debug for MatchPhraseQuery
source§impl From<MatchPhraseQuery> for Option<Query>
impl From<MatchPhraseQuery> for Option<Query>
source§fn from(q: MatchPhraseQuery) -> Self
fn from(q: MatchPhraseQuery) -> Self
source§impl From<MatchPhraseQuery> for Query
impl From<MatchPhraseQuery> for Query
source§fn from(q: MatchPhraseQuery) -> Self
fn from(q: MatchPhraseQuery) -> Self
source§impl IntoIterator for MatchPhraseQuery
impl IntoIterator for MatchPhraseQuery
§type Item = MatchPhraseQuery
type Item = MatchPhraseQuery
§type IntoIter = IntoIter<<MatchPhraseQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<MatchPhraseQuery as IntoIterator>::Item>
source§impl PartialEq<MatchPhraseQuery> for MatchPhraseQuery
impl PartialEq<MatchPhraseQuery> for MatchPhraseQuery
source§fn eq(&self, other: &MatchPhraseQuery) -> bool
fn eq(&self, other: &MatchPhraseQuery) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<MatchPhraseQuery> for Query
impl PartialEq<MatchPhraseQuery> for Query
source§fn eq(&self, other: &MatchPhraseQuery) -> bool
fn eq(&self, other: &MatchPhraseQuery) -> bool
self
and other
values to be equal, and is used
by ==
.