SELECT * FROM products WHERE (stock_code = '1234' AND category_code = '3214') OR (stock_code = '1234' AND category_code = '3214')
此外,我希望命名的查询被用于bcz在结果匹配的查询是必要的
我现在有这个
$params['body']['query']['bool']['must']['bool']['should'][]=[
'match' => [
'stock_code' => [
'query' => $val->stock_code,
'_name' => $val->stock_code,
],
]
];
1条答案
按热度按时间yhuiod9q1#
您需要使用两个
bool/filter
(即内部AND)在bool/should
(即,外部OR):