Browse Source

[Docs] Explain incomplete dates in range queries (#30689)

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
Christoph Büscher 7 years ago
parent
commit
3f78b3f5e1
1 changed files with 6 additions and 0 deletions
  1. 6 0
      docs/reference/query-dsl/range-query.asciidoc

+ 6 - 0
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