Struct elastiql::search::query::RangeQuery [−][src]
pub struct RangeQuery { pub field: String, pub greater_than: Option<String>, pub greater_than_or_equal_to: Option<String>, pub less_than: Option<String>, pub less_than_or_equal_to: Option<String>, pub time_zone: Option<String>, pub boost: Option<f64>, }
Expand description
A Range query returns documents that contain terms within a provided range.
Fields
field: String
The name of the field to query.
greater_than: Option<String>
Greater than.
Although this field is a String
, it will match numerical
fields; e.g.
"1.2"
will match fields containing the floating point value 1.2
.
greater_than_or_equal_to: Option<String>
Greater than or equal to.
Although this field is a String
, it will match numerical
fields; e.g.
"1.2"
will match fields containing the floating point value 1.2
.
less_than: Option<String>
Less than.
Although this field is a String
, it will match numerical
fields; e.g.
"1.2"
will match fields containing the floating point value 1.2
.
less_than_or_equal_to: Option<String>
Less than or equal to.
Although this field is a String
, it will match numerical
fields; e.g.
"1.2"
will match fields containing the floating point value 1.2
.
time_zone: Option<String>
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
.
Note: This parameter does not affect the date math value of now
.
now
is always the current system time in UTC. However, this parameter
does convert dates calculated using now and date math rounding. For
example, it will convert a value of now/d
or now-7d/d
.
boost: Option<f64>
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.
Implementations
Create a builder for building RangeQuery
.
On the builder, call .field(...)
, .greater_than(...)
(optional), .greater_than_or_equal_to(...)
(optional), .less_than(...)
(optional), .less_than_or_equal_to(...)
(optional), .time_zone(...)
(optional), .boost(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of RangeQuery
.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for RangeQuery
impl Send for RangeQuery
impl Sync for RangeQuery
impl Unpin for RangeQuery
impl UnwindSafe for RangeQuery
Blanket Implementations
Mutably borrows from an owned value. Read more