Struct elasticsearch_dsl::search::queries::full_text::MatchPhrasePrefixQuery
source · [−]pub struct MatchPhrasePrefixQuery { /* private fields */ }
Expand description
Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is treated as a prefix, matching any words that begin with that term.
To create a MatchPhrasePrefix query:
Query::match_phrase_prefix("test", "search text")
.boost(2)
.name("test");
Implementations
sourceimpl MatchPhrasePrefixQuery
impl MatchPhrasePrefixQuery
sourcepub fn analyzer<T>(self, analyzer: T) -> Self where
T: ToString,
pub fn analyzer<T>(self, analyzer: T) -> Self where
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 max_expansions(self, max_expansions: u8) -> Self
pub fn max_expansions(self, max_expansions: u8) -> Self
Maximum number of terms to which the query will expand.
Defaults to 50
.
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 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) -> Self where
T: AsPrimitive<f32>,
pub fn boost<T>(self, boost: T) -> Self where
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 MatchPhrasePrefixQuery
impl Clone for MatchPhrasePrefixQuery
sourcefn clone(&self) -> MatchPhrasePrefixQuery
fn clone(&self) -> MatchPhrasePrefixQuery
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MatchPhrasePrefixQuery
impl Debug for MatchPhrasePrefixQuery
sourceimpl From<MatchPhrasePrefixQuery> for Option<Query>
impl From<MatchPhrasePrefixQuery> for Option<Query>
sourcefn from(q: MatchPhrasePrefixQuery) -> Self
fn from(q: MatchPhrasePrefixQuery) -> Self
Converts to this type from the input type.
sourceimpl From<MatchPhrasePrefixQuery> for Query
impl From<MatchPhrasePrefixQuery> for Query
sourcefn from(q: MatchPhrasePrefixQuery) -> Self
fn from(q: MatchPhrasePrefixQuery) -> Self
Converts to this type from the input type.
sourceimpl IntoIterator for MatchPhrasePrefixQuery
impl IntoIterator for MatchPhrasePrefixQuery
type Item = MatchPhrasePrefixQuery
type Item = MatchPhrasePrefixQuery
The type of the elements being iterated over.
type IntoIter = IntoIter<<MatchPhrasePrefixQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<MatchPhrasePrefixQuery as IntoIterator>::Item>
Which kind of iterator are we turning this into?
sourceimpl PartialEq<MatchPhrasePrefixQuery> for MatchPhrasePrefixQuery
impl PartialEq<MatchPhrasePrefixQuery> for MatchPhrasePrefixQuery
sourcefn eq(&self, other: &MatchPhrasePrefixQuery) -> bool
fn eq(&self, other: &MatchPhrasePrefixQuery) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MatchPhrasePrefixQuery) -> bool
fn ne(&self, other: &MatchPhrasePrefixQuery) -> bool
This method tests for !=
.
sourceimpl PartialEq<MatchPhrasePrefixQuery> for Query
impl PartialEq<MatchPhrasePrefixQuery> for Query
sourceimpl PartialEq<Query> for MatchPhrasePrefixQuery
impl PartialEq<Query> for MatchPhrasePrefixQuery
sourceimpl Serialize for MatchPhrasePrefixQuery
impl Serialize for MatchPhrasePrefixQuery
impl StructuralPartialEq for MatchPhrasePrefixQuery
Auto Trait Implementations
impl RefUnwindSafe for MatchPhrasePrefixQuery
impl Send for MatchPhrasePrefixQuery
impl Sync for MatchPhrasePrefixQuery
impl Unpin for MatchPhrasePrefixQuery
impl UnwindSafe for MatchPhrasePrefixQuery
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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