also use the time unit configured by numeric_resolution if fallbacking to parsing a timestamp number
This commit is contained in:
parent
9bc9e3f0bd
commit
6d975cd6b7
|
@ -357,7 +357,8 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
|
||||||
return dateTimeFormatter.parser().parseMillis(value);
|
return dateTimeFormatter.parser().parseMillis(value);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
try {
|
try {
|
||||||
return Long.parseLong(value);
|
long time = Long.parseLong(value);
|
||||||
|
return timeUnit.toMillis(time);
|
||||||
} catch (NumberFormatException e1) {
|
} catch (NumberFormatException e1) {
|
||||||
throw new MapperParsingException("failed to parse date field, tried both date format [" + dateTimeFormatter.format() + "], and timestamp number", e);
|
throw new MapperParsingException("failed to parse date field, tried both date format [" + dateTimeFormatter.format() + "], and timestamp number", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue