【发布时间】:2018-04-14 19:44:41
【问题描述】:
我想过滤搜索结果。我想搜索如果未指定“manuf_id”,则应该返回所有记录。下面是我在弹性中的搜索查询。
$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]
]
]
]
]
],
];
以上查询未运行。有什么我想念的吗?任何帮助都会很棒。
【问题讨论】:
标签: php mysql elasticsearch