pub struct RangeQuery { /* private fields */ }
Expand description
Returns documents that contain terms within a provided range.
To create a range query with numeric values:
Query::range("numeric_field")
.gt(1)
.lt(3)
.boost(2)
.name("range_query");
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html
Implementations§
Source§impl RangeQuery
impl RangeQuery
pub fn serialize<__S>(
__self: &RangeQuery,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
Source§impl RangeQuery
impl RangeQuery
Sourcepub fn format<T>(self, format: T) -> Selfwhere
T: ToString,
pub fn format<T>(self, format: T) -> Selfwhere
T: ToString,
Date format used to convert date
values in the query.
By default, Elasticsearch uses the
date format
provided in the <field>
’s mapping. This value overrides that mapping format.
For valid syntax, see
format
.
If a format or date value is incomplete, the range query replaces any missing components with default values. See Missing date components.
Sourcepub fn relation(self, relation: RangeRelation) -> Self
pub fn relation(self, relation: RangeRelation) -> Self
Indicates how the range query matches values for range fields.
Sourcepub fn time_zone<T>(self, time_zone: T) -> Selfwhere
T: ToString,
pub fn time_zone<T>(self, time_zone: T) -> Selfwhere
T: ToString,
Coordinated Universal Time (UTC) offset
or IANA time zone
used to convert date
values in the query to UTC.
Valid values are ISO 8601 UTC offsets, such as +01:00
or -08:00
, and IANA time zone IDs,
such as America/Los_Angeles
.
For an example query using the time_zone
parameter, see
Time zone in range
queries.
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 RangeQuery
impl Clone for RangeQuery
Source§fn clone(&self) -> RangeQuery
fn clone(&self) -> RangeQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more