在使用match和rang组合查询时
GET vdc/kline/_search
{
"query": {
"bool": {
"must": [
{"match": {"baseCurrency": "btc"}},
{"match": {"quoteCurrency": "usdt"}},
{"match": {"platformName": "ZB网"}}
],"range": {
"time": {
"gte": 1594508400000,
"lte": 1594591200000
}
}
}
}
}
报错
报错:
"type": "parsing_exception",
"reason": "[bool] query does not support [range]",
修改:
GET vdc/kline/_search
{
"query": {
"bool": {
"must": [
{"match": {"baseCurrency": "btc"}},
{"match": {"quoteCurrency": "usdt"}},
{"match": {"platformName": "ZB网"}}
],
"filter": {
"range": {
"time": {
"gte": 1594508400000,
"lte": 1594591200000
}
}
}
}
}
}