mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-20 03:45:02 +00:00
don't xcontent locale if its ROOT for date since its the default
This commit is contained in:
parent
497032e6e7
commit
d67b8f1310
@ -448,7 +448,8 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
|
||||
if (timeUnit != Defaults.TIME_UNIT) {
|
||||
builder.field("numeric_resolution", timeUnit.name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
if (dateTimeFormatter.locale() != null) {
|
||||
// only serialize locale if needed, ROOT is the default, so no need to serialize that case as well...
|
||||
if (dateTimeFormatter.locale() != null && dateTimeFormatter.locale() != Locale.ROOT) {
|
||||
builder.field("locale", dateTimeFormatter.locale());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user