-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass
java.locale.providers=COMPAT
to Java 9 onwards (#28080)
Java 9 added some enhancements to the internationalization support that impact our date parsing support. To ensure flawless BWC and consistent behavior going forward Java 9 runtimes requrie the system property `java.locale.providers=COMPAT` to be set. Closes #10984
- Loading branch information
Showing
3 changed files
with
41 additions
and
38 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
rest-api-spec/src/main/resources/rest-api-spec/test/search/180_local_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,38 @@ | ||
--- | ||
"Test Index and Search locale dependent mappings / dates": | ||
- skip: | ||
version: " - 6.99.99" | ||
reason: JDK9 only supports this with a special sysproperty added in 7.0.0 | ||
- do: | ||
indices.create: | ||
index: test_index | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
mappings: | ||
doc: | ||
properties: | ||
date_field: | ||
type: date | ||
format: "E, d MMM yyyy HH:mm:ss Z" | ||
locale: "de" | ||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{"index": {"_index": "test_index", "_type": "doc", "_id": "1"}}' | ||
- '{"date_field": "Mi, 06 Dez 2000 02:55:00 -0800"}' | ||
- '{"index": {"_index": "test_index", "_type": "doc", "_id": "2"}}' | ||
- '{"date_field": "Do, 07 Dez 2000 02:55:00 -0800"}' | ||
|
||
- do: | ||
search: | ||
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: | ||
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 } |