POST rcd_2019/_search
{
"query": {
"bool": {
"filter": {
"range": {
"doneTm": {
"gte": "[size=14]2019-07-01 12:00:00[/size]",
"lte": "now",
"format": "yyyy-dd-MM hh:mm:ss"
}
}
},
"must": [
{
"match": {
"msg": "mengirim"
}
}
]
}
}
}
这里有个问题, 开始时间如果是12点之前没问题,改成12后比如 2019-07-01 13:00:00就会报错, 时间格式出了什么问题么?"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse date field [2019-07-01 14:00:00] with format [yyyy-dd-MM hh:mm:ss]: [failed to parse date field [2019-07-01 14:00:00] with format [yyyy-dd-MM hh:mm:ss]]"
}
],
}
找到问题了。。。
"format": "yyyy-dd-MM hh:mm:ss" hh应为HH
0 个回复