I want to filter search result. I want to search that if 'manuf_id' is not specified than is should return all records. I also want to put AND condition in term. below is my search query in elastic.
below is my code.
$params = [
'index' => $this->client->getIndex(),
'type' => $this->client->getType(),
"from" => $from, "size" => $productPerPage,
'body' => [
"query" => [
"bool" => [
"must" => [
[
"multi_match" => [
"fields" => ["prod_name", "prod_seo_name"],
"type" => "phrase_prefix",
"query" => 'samsung'
]
],
//$conditionArr
[
"term"=> ["manuf_id"=>null]
]
]
]
]
],
];
Above query is not running. is there something I am missing? ANy help would be great.