Struct elasticsearch_dsl::search::queries::term_level::PrefixQuery
source · pub struct PrefixQuery { /* private fields */ }Expand description
Returns documents that contain a specific prefix in a provided field.
To create a prefix query with numeric values:
Query::prefix("test", 123);To create a prefix query with string values and optional fields:
Query::prefix("test", "username")
.boost(2)
.name("test");https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html
Implementations§
source§impl PrefixQuery
impl PrefixQuery
pub fn serialize<__S>(
__self: &PrefixQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
source§impl PrefixQuery
impl PrefixQuery
sourcepub fn rewrite(self, rewrite: Rewrite) -> Self
pub fn rewrite(self, rewrite: Rewrite) -> Self
Method used to rewrite the query. For valid values and more information, see the rewrite parameter.
sourcepub fn case_insensitive(self, case_insensitive: bool) -> Self
pub fn case_insensitive(self, case_insensitive: bool) -> Self
Allows ASCII case insensitive matching of the value with the indexed field values when set to true. Default is false which means the case sensitivity of matching depends on the underlying field’s mapping.
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 PrefixQuery
impl Clone for PrefixQuery
source§fn clone(&self) -> PrefixQuery
fn clone(&self) -> PrefixQuery
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for PrefixQuery
impl Debug for PrefixQuery
source§impl From<PrefixQuery> for MultiTermQuery
impl From<PrefixQuery> for MultiTermQuery
source§fn from(q: PrefixQuery) -> Self
fn from(q: PrefixQuery) -> Self
source§impl From<PrefixQuery> for Option<MultiTermQuery>
impl From<PrefixQuery> for Option<MultiTermQuery>
source§fn from(q: PrefixQuery) -> Self
fn from(q: PrefixQuery) -> Self
source§impl From<PrefixQuery> for Option<Query>
impl From<PrefixQuery> for Option<Query>
source§fn from(q: PrefixQuery) -> Self
fn from(q: PrefixQuery) -> Self
source§impl From<PrefixQuery> for Query
impl From<PrefixQuery> for Query
source§fn from(q: PrefixQuery) -> Self
fn from(q: PrefixQuery) -> Self
source§impl IntoIterator for PrefixQuery
impl IntoIterator for PrefixQuery
§type Item = PrefixQuery
type Item = PrefixQuery
§type IntoIter = IntoIter<<PrefixQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<PrefixQuery as IntoIterator>::Item>
source§impl PartialEq<MultiTermQuery> for PrefixQuery
impl PartialEq<MultiTermQuery> for PrefixQuery
source§impl PartialEq<PrefixQuery> for MultiTermQuery
impl PartialEq<PrefixQuery> for MultiTermQuery
source§impl PartialEq<PrefixQuery> for Query
impl PartialEq<PrefixQuery> for Query
source§impl PartialEq<Query> for PrefixQuery
impl PartialEq<Query> for PrefixQuery
source§impl PartialEq for PrefixQuery
impl PartialEq for PrefixQuery
source§impl Serialize for PrefixQuery
impl Serialize for PrefixQuery
impl StructuralPartialEq for PrefixQuery
Auto Trait Implementations§
impl Freeze for PrefixQuery
impl RefUnwindSafe for PrefixQuery
impl Send for PrefixQuery
impl Sync for PrefixQuery
impl Unpin for PrefixQuery
impl UnwindSafe for PrefixQuery
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)