<commit_before>[[query-dsl-range-query]]
=== Range Query

Matches documents with fields that have terms within a certain range.
The type of the Lucene query depends on the field type, for `string`
fields, the `TermRangeQuery`, while for number/date fields, the query is
a `NumericRangeQuery`. The following example returns all documents where
`age` is between `10` and `20`:

[source,js]
--------------------------------------------------
{
    "range" : {
        "age" : {
            "gte" : 10,
            "lte" : 20,
            "boost" : 2.0
        }
    }
}
--------------------------------------------------

The `range` query accepts the following parameters:

[horizontal]
`gte`:: 	Greater-than or equal to
`gt`::  	Greater-than
`lte`:: 	Less-than or equal to
`lt`::  	Less-than
`boost`:: 	Sets the boost value of the query, defaults to `1.0`


[[ranges-on-dates]]
==== Ranges on date fields

When running `range` queries on fields of type <<date,`date`>>, ranges can be
specified using <<date-math>>::

[source,js]
--------------------------------------------------
{
    "range" : {
        "date" : {
            "gte" : "now-1d/d",<commit_msg>Duplicated colon was removed (#17988)<commit_after>[[query-dsl-range-query]]
=== Range Query

Matches documents with fields that have terms within a certain range.
The type of the Lucene query depends on the field type, for `string`
fields, the `TermRangeQuery`, while for number/date fields, the query is
a `NumericRangeQuery`. The following example returns all documents where
`age` is between `10` and `20`:

[source,js]
--------------------------------------------------
{
    "range" : {
        "age" : {
            "gte" : 10,
            "lte" : 20,
            "boost" : 2.0
        }
    }
}
--------------------------------------------------

The `range` query accepts the following parameters:

[horizontal]
`gte`:: 	Greater-than or equal to
`gt`::  	Greater-than
`lte`:: 	Less-than or equal to
`lt`::  	Less-than
`boost`:: 	Sets the boost value of the query, defaults to `1.0`


[[ranges-on-dates]]
==== Ranges on date fields

When running `range` queries on fields of type <<date,`date`>>, ranges can be
specified using <<date-math>>:

[source,js]
--------------------------------------------------
{
    "range" : {
        "date" : {
            "gte" : "now-1d/d",
{'fraction_non_alphanumeric': 0.24861170439982913, 'fraction_numerical': 0.013242204186245195, 'mean_word_length': 1.8665850673194615, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2757561', 'n_tokens_mistral': 713, 'n_tokens_neox': 691, 'n_words': 241}