mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Use CLDR locale provider on JDK 23+ (#110222)
JDK 23 removes the COMPAT locale provider, leaving CLDR as the only option. This commit configures Elasticsearch to use the CLDR provider when on JDK 23, but still use the existing COMPAT provider when on JDK 22 and below. This causes some differences in locale behaviour; this also adapts various tests to still work whether run on COMPAT or CLDR.
This commit is contained in:
parent
0074c14bfa
commit
a36d90cf34
30 changed files with 73 additions and 92 deletions
|
@ -12,7 +12,7 @@ setup:
|
|||
day_of_week:
|
||||
type: keyword
|
||||
script: |
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT));
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH));
|
||||
# Test fetching from _source
|
||||
day_of_week_from_source:
|
||||
type: keyword
|
||||
|
@ -75,7 +75,7 @@ setup:
|
|||
- match: {sensor.mappings.runtime.day_of_week.type: keyword }
|
||||
- match:
|
||||
sensor.mappings.runtime.day_of_week.script.source: |
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT));
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH));
|
||||
- match: {sensor.mappings.runtime.day_of_week.script.lang: painless }
|
||||
|
||||
# --- TODO get field mappings needs to be adapted
|
||||
|
@ -90,7 +90,7 @@ setup:
|
|||
# type: keyword
|
||||
# script:
|
||||
# source: |
|
||||
# emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT));
|
||||
# emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH));
|
||||
# lang: painless
|
||||
# meta: {}
|
||||
#
|
||||
|
|
|
@ -21,7 +21,7 @@ setup:
|
|||
day_of_week:
|
||||
type: keyword
|
||||
script: |
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT));
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH));
|
||||
# Test fetching from _source
|
||||
day_of_week_from_source:
|
||||
type: keyword
|
||||
|
@ -74,7 +74,7 @@ setup:
|
|||
- match: {sensor.mappings.properties.day_of_week.type: keyword }
|
||||
- match:
|
||||
sensor.mappings.properties.day_of_week.script.source: |
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT));
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH));
|
||||
- match: {sensor.mappings.properties.day_of_week.script.lang: painless }
|
||||
|
||||
---
|
||||
|
|
|
@ -34,7 +34,7 @@ setup:
|
|||
day_of_week:
|
||||
type: keyword
|
||||
script:
|
||||
source: "emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
|
||||
source: "emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))"
|
||||
|
||||
- match: {indices: ["test-1"]}
|
||||
- length: {fields.timestamp: 1}
|
||||
|
@ -78,7 +78,7 @@ setup:
|
|||
day_of_week:
|
||||
type: keyword
|
||||
script:
|
||||
source: "emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
|
||||
source: "emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))"
|
||||
|
||||
- match: {indices: ["test-1", "test-2"]}
|
||||
- length: {fields.day_of_week: 1}
|
||||
|
|
|
@ -12,7 +12,7 @@ setup:
|
|||
day_of_week:
|
||||
type: keyword
|
||||
script: |
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT));
|
||||
emit(doc['timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH));
|
||||
tomorrow:
|
||||
type: date
|
||||
script:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue