版本: 6.8-7.15
简而言之,当 Elasticsearch 尝试解析时间值时遇到了意外的数据类型(如对象或数组),而不是字符串或 null 值,就会发生此错误。要解决此问题,请确保传递的时间值是正确格式的字符串或 null 值。请检查您的数据输入或生成此数据的脚本。如果您使用的是日期格式化程序,请验证它是否产生了正确的输出。此外,还要确保您的映射正确设置为处理日期或时间字段。
日志上下文 #
日志 “could not parse time value. expected either a string or a null value but found [{}]” 的类名是 WatcherDateTimeUtils.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:
} catch (ElasticsearchParseException epe) {
throw new ElasticsearchParseException("failed to parse time unit", epe);
}
}
throw new ElasticsearchParseException("could not parse time value. expected either a string or a null value but found [{}] " +
"instead", token);
}
/**
* Parse a {@link TimeValue} with support for fractional values.
*/





