I'm not able to use Elastica to filter multiple values for the same field.
Single value for a field works :
$filtre = array();
array_push($filtre, $qb->filter()->term(array('id' => '60')));
$elastica_query->setQuery(
$qb->query()->filtered(
$qb->query()->match_all(),
$qb->filter()->bool()->addMust($filtre)
)
)
Which gives me the wanted result. But when I try to add another value for the same field, there are no results showing.
$filtre = array();
array_push($filtre, $qb->filter()->term(array('id' => '60')));
array_push($filtre, $qb->filter()->term(array('id' => '87')));
$elastica_query->setQuery(
$qb->query()->filtered(
$qb->query()->match_all(),
$qb->filter()->bool()->addMust($filtre)
)
)
What am I doing wrong ?
PS : If I add filters for other fields, everything works fine, but just adding a second value for any field doesn't work.