0
我是ElasticSearch的新手,所以很抱歉,如果這不是問題。我試圖讓誰擁有的薪水低於某個值的用戶,但我得到這個錯誤:ElasticSearch - 範圍查詢不起作用
query_parsing_exception: No query registered for [salary]
我的其他查詢工作正常,只有range query
失敗,這是我的代碼:
$items = $this->client->search([
'index' => 'offerprofiles',
'type' => 'profile',
'body' => [
'query' => [
'bool' => [
"must" => [
"match" => [
"jobcategories.name" => [
"query" => $query['category']
]
],
"range" => [
"salary" => [
"lt" => 20
]
]
],
"should" => [
"match" => [
"skills.name" => [
"query" => $query['skills']
]
]
],
"minimum_should_match" => 1
]
],
'size' => 50,
]
]);
如果我刪除範圍查詢,然後一切工作正常,我也檢查索引值和工資是有(整數)。 謝謝
謝謝你一噸,現在一切都有道理 – Alen