我想日期时间2017-02-17T15:02:00
在下面的查询来替代now
:如何用Elasticsearch查询中的具体日期时间替换“now”?
POST /myindex/_search
{
"size": 0,
"aggs": {
"range": {
"date_range": {
"field": "Datetime",
"ranges": [
{ "to": "now-1H/H" },
{ "from": "now/H" }
]
}
}
}
}
如果我直接2017-02-17T15:02:00
替代now
,则查询失败,错误:
type": "illegal_argument_exception", "reason": "Unrecognized chars at the end of [2017-02-17T15:02:00/H]: [/H]"
此外,如何能我指定了一小时而不是1H?