我想从弹性搜索中获取总记录数。 下面是我的代码
$params = [
'index' => $this->client->getIndex(),
'type' => $this->client->getType(),
"from" => 0, "size" => 10,
//"scroll" => "1m",
'body' => [
"query" => [
"bool" => [
"must" => [
[
"multi_match" => [
"fields" => ["prod_name", "prod_seo_name"],
"type" => "phrase_prefix",
"query" => $query
]
],
[
"term"=> ["cat_type_id"=>1]
]
]
]
]
],
];
执行手动查询会产生400条记录,而弹性搜索会产生10条记录。无论大小如何,我如何获得总记录?
答案 0 :(得分:0)
我认为应该可以访问:
{{1}}