diff options
Diffstat (limited to 'docs/reference/query-dsl/queries/range-query.asciidoc')
-rw-r--r-- | docs/reference/query-dsl/queries/range-query.asciidoc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/reference/query-dsl/queries/range-query.asciidoc b/docs/reference/query-dsl/queries/range-query.asciidoc new file mode 100644 index 0000000..cf8a9da --- /dev/null +++ b/docs/reference/query-dsl/queries/range-query.asciidoc @@ -0,0 +1,31 @@ +[[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` + |