also use the time unit configured by numeric_resolution if fallbacking to parsing a timestamp number

This commit is contained in:
Njal Karevoll 2011-09-21 16:40:41 +02:00 committed by Shay Banon
parent 9bc9e3f0bd
commit 6d975cd6b7
1 changed files with 2 additions and 1 deletions

View File

@ -357,7 +357,8 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
return dateTimeFormatter.parser().parseMillis(value);
} catch (RuntimeException e) {
try {
return Long.parseLong(value);
long time = Long.parseLong(value);
return timeUnit.toMillis(time);
} catch (NumberFormatException e1) {
throw new MapperParsingException("failed to parse date field, tried both date format [" + dateTimeFormatter.format() + "], and timestamp number", e);
}