嗨,我想排除两个值内的结果
喜欢
if ($type == 'doc' && $statut == 'inactive')
return false;
所以我用 bool(boolean) 像
$filter ['bool'] ['should'] ['bool'] ['must_not'][] = array (
'term' => array (
'type' => "doc"
),
'term' => array (
'statut' => "inactive"
)
);
但是那行不通,你能帮我吗
编辑:显然我想排除结果具有类型=='doc'AND statut =='inactive'
最佳答案
我发现
$filter ['bool'] ['must_not'] [] = array(
'bool' => array(
'must' => array(
array('term' => array('type' => "doc" )),
array('term' => array('statut' => "inactive")),
)
)
);
关于php - Elasticsearch排除结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33500946/