Skip to content

Commit 3b42dde

Browse files
committed
[Docs] Add note for date patterns used for index search. (#42810)
Add an explanatory NOTE section to draw attention to the difference between small and capital letters used for the index date patterns. e.g.: HH vs hh, MM vs mm. Closes: #22322 (cherry picked from commit c812541)
1 parent 428beab commit 3b42dde

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/reference/api-conventions.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ Where:
8686
`date_format`:: is the optional format in which the computed date should be rendered. Defaults to `yyyy.MM.dd`. Format should be compatible with java-time https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
8787
`time_zone`:: is the optional time zone. Defaults to `utc`.
8888

89+
NOTE: Pay attention to the usage of small vs capital letters used in the `date_format`. For example:
90+
`mm` denotes minute of hour, while `MM` denotes month of year. Similarly `hh` denotes the hour in the
91+
`1-12` range in combination with `AM/PM`, while `HH` denotes the hour in the `0-23` 24-hour range.
92+
8993
Date math expressions are resolved locale-independent. Consequently, it is not possible to use any other
9094
calendars than the Gregorian calendar.
9195

docs/reference/ingest/processors/date-index-name.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ understands this to mean `2016-04-01` as is explained in the <<date-math-index-n
140140
| `date_formats` | no | yyyy-MM-dd+++'T'+++HH:mm:ss.SSSXX | An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
141141
| `timezone` | no | UTC | The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names.
142142
| `locale` | no | ENGLISH | The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days.
143-
| `index_name_format` | no | yyyy-MM-dd | The format to be used when printing the parsed date into the index name. An valid java time pattern is expected here. Supports <<accessing-template-fields,template snippets>>.
143+
| `index_name_format` | no | yyyy-MM-dd | The format to be used when printing the parsed date into the index name. A valid java time pattern is expected here. Supports <<accessing-template-fields,template snippets>>.
144144
include::common-options.asciidoc[]
145145
|======

0 commit comments

Comments
 (0)