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