query_string
是否支持带日期的GT操作?
{
"_source": {
"includes": [
"id"
]
},
"size": 20,
"sort": [
{
"published": {
"order": "DESC"
}
}
],
"query": {
"query_string": {
"query": "updated > (2014-11-01T00:00:00Z)"
}
}
}
投掷Failed to parse query [updated > (2014-11-01T00:00:00Z)]
我的查询出了什么问题?
映射为:
"updated": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ssZ"
}
查询需要这样,即在Lucene表达式语言中
"query": "updated:{2014-11-01 TO *}"
然而,您最好使用一个简单的range
查询:
"range": {
"updated": {
"gt": "2014-11-01T00:00:00Z"
}
}