forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java.time] Retain prefixed date pattern in formatter (elastic#48703)
JavaDateFormatter should keep the pattern with the prefixed 8 as it will be used for serialisation. The stripped pattern should be used for the enclosed formatters. closes elastic#48698
- Loading branch information
Showing
3 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
rest-api-spec/src/main/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
"Test Index and Search locale dependent mappings / dates": | ||
- skip: | ||
version: " - 6.1.99" | ||
reason: JDK9 only supports this with a special sysproperty added in 6.2.0 | ||
- do: | ||
indices.create: | ||
index: test_index | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
mappings: | ||
properties: | ||
date_field: | ||
type: date | ||
format: "8E, d MMM uuuu HH:mm:ss Z" | ||
locale: "de" | ||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{"index": {"_index": "test_index", "_id": "1"}}' | ||
- '{"date_field": "Mi, 06 Dez 2000 02:55:00 -0800"}' | ||
- '{"index": {"_index": "test_index", "_id": "2"}}' | ||
- '{"date_field": "Do, 07 Dez 2000 02:55:00 -0800"}' | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
index: test_index | ||
body: {"query" : {"range" : {"date_field" : {"gte": "Di, 05 Dez 2000 02:55:00 -0800", "lte": "Do, 07 Dez 2000 00:00:00 -0800"}}}} | ||
- match: { hits.total: 1 } | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
index: test_index | ||
body: {"query" : {"range" : {"date_field" : {"gte": "Di, 05 Dez 2000 02:55:00 -0800", "lte": "Fr, 08 Dez 2000 00:00:00 -0800"}}}} | ||
- match: { hits.total: 2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters