Struct elasticsearch_dsl::search::queries::term_level::RangeQuery
source · 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 moresource§impl Debug for RangeQuery
impl Debug for RangeQuery
source§impl From<RangeQuery> for MultiTermQuery
impl From<RangeQuery> for MultiTermQuery
source§fn from(q: RangeQuery) -> Self
fn from(q: RangeQuery) -> Self
source§impl From<RangeQuery> for Option<MultiTermQuery>
impl From<RangeQuery> for Option<MultiTermQuery>
source§fn from(q: RangeQuery) -> Self
fn from(q: RangeQuery) -> Self
source§impl From<RangeQuery> for Option<Query>
impl From<RangeQuery> for Option<Query>
source§fn from(q: RangeQuery) -> Self
fn from(q: RangeQuery) -> Self
source§impl From<RangeQuery> for Query
impl From<RangeQuery> for Query
source§fn from(q: RangeQuery) -> Self
fn from(q: RangeQuery) -> Self
source§impl IntoIterator for RangeQuery
impl IntoIterator for RangeQuery
§type Item = RangeQuery
type Item = RangeQuery
§type IntoIter = IntoIter<<RangeQuery as IntoIterator>::Item>
type IntoIter = IntoIter<<RangeQuery as IntoIterator>::Item>
source§impl PartialEq<MultiTermQuery> for RangeQuery
impl PartialEq<MultiTermQuery> for RangeQuery
source§impl PartialEq<Query> for RangeQuery
impl PartialEq<Query> for RangeQuery
source§impl PartialEq<RangeQuery> for MultiTermQuery
impl PartialEq<RangeQuery> for MultiTermQuery
source§impl PartialEq<RangeQuery> for Query
impl PartialEq<RangeQuery> for Query
source§impl PartialEq for RangeQuery
impl PartialEq for RangeQuery
source§impl Serialize for RangeQuery
impl Serialize for RangeQuery
impl StructuralPartialEq for RangeQuery
Auto Trait Implementations§
impl Freeze for RangeQuery
impl RefUnwindSafe for RangeQuery
impl Send for RangeQuery
impl Sync for RangeQuery
impl Unpin for RangeQuery
impl UnwindSafe for RangeQuery
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)