From 77b3dcad580a13208c3139da89abf78395ee3834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 17 May 2018 17:03:07 +0200 Subject: [PATCH] [Docs] Explain incomplete dates in range queries The current documentation isn't very clear about how incomplete dates are treated when specifying custom formats in a `range` query. This change adds a note explaining how missing month or year coordinates translate to dates that have the missings slots filled with unix time start date (1970-01-01) Closes #30634 --- docs/reference/query-dsl/range-query.asciidoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/reference/query-dsl/range-query.asciidoc b/docs/reference/query-dsl/range-query.asciidoc index a0005ff3ff22f..620a175ff39a5 100644 --- a/docs/reference/query-dsl/range-query.asciidoc +++ b/docs/reference/query-dsl/range-query.asciidoc @@ -109,6 +109,12 @@ GET _search -------------------------------------------------- // CONSOLE +Note that if the date misses some of the year, month and day coordinates, the +missing parts are filled with the start of +https://en.wikipedia.org/wiki/Unix_time[unix time], which is January 1st, 1970. +This means, that when e.g. specifying `dd` as the format, a value like `"gte" : 10` +will translate to `1970-01-10T00:00:00.000Z`. + ===== Time zone in range queries Dates can be converted from another timezone to UTC either by specifying the