Struct elasticsearch_dsl::search::queries::term_level::RegexpQuery
source · pub struct RegexpQuery { /* private fields */ }
Expand description
Returns documents that contain terms matching a regular expression.
A regular expression is a way to match patterns in data using placeholder characters, called
operators. For a list of operators supported by the regexp
query, see
Regular expression syntax.
To create a regexp query:
Query::regexp("test", "username");
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
Implementations§
source§impl RegexpQuery
impl RegexpQuery
pub fn serialize<__S>(
__self: &RegexpQuery,
__serializer: __S
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
source§impl RegexpQuery
impl RegexpQuery
sourcepub fn flags<I>(self, flags: I) -> Selfwhere
I: IntoIterator<Item = RegexpFlag>,
pub fn flags<I>(self, flags: I) -> Selfwhere
I: IntoIterator<Item = RegexpFlag>,
Enables optional operators for the regular expression. For valid values and more information, see Regular expression syntax.
sourcepub fn case_insensitive(self, case_insensitive: bool) -> Self
pub fn case_insensitive(self, case_insensitive: bool) -> Self
Allows case insensitive matching of the regular expression 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 max_determinized_states(self, max_determinized_states: u64) -> Self
pub fn max_determinized_states(self, max_determinized_states: u64) -> Self
Maximum number of automaton states required for the query. Default is 10000.
Elasticsearch uses Apache Lucene internally to parse regular expressions. Lucene converts each regular expression to a finite automaton containing a number of determinized states.
You can use this parameter to prevent that conversion from unintentionally consuming too many resources. You may need to increase this limit to run complex regular expressions.
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 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 RegexpQuery
impl Clone for RegexpQuery
source§fn clone(&self) -> RegexpQuery
fn clone(&self) -> RegexpQuery
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RegexpQuery
impl Debug for RegexpQuery
source§impl From<RegexpQuery> for MultiTermQuery
impl From<RegexpQuery> for MultiTermQuery
source§fn from(q: RegexpQuery) -> Self
fn from(q: RegexpQuery) -> Self
source§impl From<RegexpQuery> for Option<MultiTermQuery>
impl From<RegexpQuery> for Option<MultiTermQuery>
source§fn from(q: RegexpQuery) -> Self
fn from(q: RegexpQuery) -> Self
source§impl From<RegexpQuery> for Option<Query>
impl From<RegexpQuery> for Option<Query>
source§fn from(q: RegexpQuery) -> Self
fn from(q: RegexpQuery) -> Self
source§impl From<RegexpQuery> for Query
impl From<RegexpQuery> for Query
source§fn from(q: RegexpQuery) -> Self
fn from(q: RegexpQuery) -> Self
source§impl IntoIterator for RegexpQuery
impl IntoIterator for RegexpQuery
§type Item = RegexpQuery
type Item = RegexpQuery
§type IntoIter = IntoIter<<RegexpQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<RegexpQuery as IntoIterator>::Item>
source§impl PartialEq<MultiTermQuery> for RegexpQuery
impl PartialEq<MultiTermQuery> for RegexpQuery
source§fn eq(&self, other: &MultiTermQuery) -> bool
fn eq(&self, other: &MultiTermQuery) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Query> for RegexpQuery
impl PartialEq<Query> for RegexpQuery
source§impl PartialEq<RegexpQuery> for MultiTermQuery
impl PartialEq<RegexpQuery> for MultiTermQuery
source§fn eq(&self, other: &RegexpQuery) -> bool
fn eq(&self, other: &RegexpQuery) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<RegexpQuery> for Query
impl PartialEq<RegexpQuery> for Query
source§fn eq(&self, other: &RegexpQuery) -> bool
fn eq(&self, other: &RegexpQuery) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for RegexpQuery
impl PartialEq for RegexpQuery
source§fn eq(&self, other: &RegexpQuery) -> bool
fn eq(&self, other: &RegexpQuery) -> bool
self
and other
values to be equal, and is used
by ==
.