以下是我用来获取过去三个月(月初)数据的查询。如何将其更改为当前周的开始?
{
"size": 10,
"timeout": "1000s",
"query": {
"bool": {
"must": [
{
"match": {
"filter_grouper": "ABC"
}
},
{
"match": {
"state": "High"
}
},
{
"range": {
"end_date": {
"gte": "now-3M/M",
"lte": "now"
}
}
}
]
}
},
"_source": [
"number",
"barrel"
]
}
我尝试使用
{
"range": {
"end_date": {
"gte": "now/yyyy-W/W",
"lte": "now"
}
}
}
但它会引发错误 -
{
"type": "parse_exception",
"reason": "operator not supported for date math [/yyyy-W/W]"
}
也一样now-1W/W