I want to pass AND condtion in elastic search query. if 'manuf_id' and 'network_id' is > 0 but this is not working properly.
"query" => [
"bool" => [
"must" => [
[
"multi_match" => [
"fields" => ["prod_name", "prod_seo_name"],
"type" => "phrase_prefix",
"query" => $query
]
],
]
]
]
if ($manufacture > 0 && $network > 0) {
$params['body']['query']['bool']['must'][] = [
'term' => ['manuf_id' => $manufacture],
'term' => ['network_id' => $network],
];
}
Any help or reference would be great.