elasticsearch/docs/reference
David Pilato 873a45eaba Search: add time zone setting for relative date math in range filter/query
Filters and Queries now supports `time_zone` parameter which defines which time zone should be applied to the query or filter to convert it to UTC time based value.

When applied on `date` fields the `range` filter and queries accept also a `time_zone` parameter.

The `time_zone` parameter will be applied to your input lower and upper bounds and will move them to UTC time based date:

[source,js]
--------------------------------------------------
{
    "constant_score": {
        "filter": {
            "range" : {
                "born" : {
                    "gte": "2012-01-01",
                    "lte": "now",
                    "time_zone": "+1:00"
                }
            }
        }
    }
}

{
    "range" : {
        "born" : {
            "gte": "2012-01-01",
            "lte": "now",
            "time_zone": "+1:00"
        }
    }
}
--------------------------------------------------

In the above examples, `gte` will be actually moved to `2011-12-31T23:00:00` UTC date.

NOTE: if you give a date with a timezone explicitly defined and use the `time_zone` parameter, `time_zone` will be
ignored. For example, setting `from` to `2012-01-01T00:00:00+01:00` with `"time_zone":"+10:00"` will still use `+01:00` time zone.

Closes #3729.
2014-08-04 15:42:03 +02:00
..
analysis
cat
cluster
docs Docs: remove duplicate label 2014-08-04 08:43:44 +02:00
images
index-modules
indices
mapping
migration
modules Support "default" for tcpNoDelay and tcpKeepAlive 2014-08-02 17:32:41 +02:00
query-dsl Search: add time zone setting for relative date math in range filter/query 2014-08-04 15:42:03 +02:00
search
setup
testing
analysis.asciidoc
api-conventions.asciidoc
cat.asciidoc
cluster.asciidoc
docs.asciidoc
getting-started.asciidoc
glossary.asciidoc
index-modules.asciidoc
index.asciidoc
indices.asciidoc
mapping.asciidoc
modules.asciidoc
query-dsl.asciidoc
search.asciidoc
setup.asciidoc
testing.asciidoc