Elasticsearch6.40過濾查詢報錯
es過濾查詢:
GET /megacorp/employee/_search{ "query" : { "filtered" : { "filter" : { "range" : { "age" : { "gt" : 30 } } }, "query" : { "match" : { "last_name" : "smith" } } } }}
報錯:
{ "error": { "root_cause": [ { "type": "parsing_exception", "reason": "no [query] registered for [filtered]", "line": 3, "col": 22 } ], "type": "parsing_exception", "reason": "no [query] registered for [filtered]", "line": 3, "col": 22 }, "status": 400}
原因:
過濾查詢已經被棄用,並在ES5.0中刪除,現改用bool/must/filter查詢
GET /megacorp/employee/_search{ "query" : { "bool" : { "filter" : { "range" : { "age" : { "gt" : 30 } } }, "must" : { "match" : { "last_name" : "smith" } } } }}
推薦閱讀:
※大數據下的技術
※何處安放的數據
※大數據平台的建設目標
※政務大數據的運營
※大數據碼畜生存指南
TAG:大數據 |