0
嘗試在Elasticsearch中查詢w/PHP客戶端並優先部分詞匹配,但仍包含模糊匹配。如果我刪除了address.company匹配塊,查詢就會按預期工作,但無論我如何對其進行框架化處理,它都會隨之崩潰。我在格式化上迷失了,還包括了優先級較低的模糊搜索?Elasticsearch部分匹配或模糊匹配,提升部分結果
$search_data = [
"from" => (int) $start, "size" => (int) $count,
'query' => [
'bool' => [
'filter' => [
['term' => ['active' => 1]],
['term' => ['type' => 2]],
],
'must' => [
'wildcard' => [
'address.company' => '*' . $search_query . '*'
],
'match' => [
'address.company' => [
'query' => $search_query,
'operator' => 'and',
'fuzziness' => 'AUTO',
],
],
],
],
],
];
你能分享你的模式映射嗎 – user3775217