我使用搜索查询,其中$query
是字符串:
$params = array();
$params['body']['query']['match']['name'] = $query;
$this->result = $this->client->search($params);
如果在搜索后执行var_dump($this->result)
:
array(4) {
["took"]=>
int(1)
["timed_out"]=>
bool(false)
["_shards"]=>
array(3) {
["total"]=>
int(12)
["successful"]=>
int(12)
["failed"]=>
int(0)
}
["hits"]=>
array(3) {
["total"]=>
int(0)
["max_score"]=>
NULL
["hits"]=>
array(0) {
}
}
}
我得到没有信息的数组。只有系统字段。我怎么能得到结果?