I am using a SearchHitIterator
in php like this
$params = [
'index' => 'empire',
'body' => [
'query' => [
'match' => [
"entity.$field" => [
'query' => $query,
'analyzer' => 'my_analyzer'
]
]
]
]
];
$pages = new SearchResponseIterator($this->client, $params);
$hits = new SearchHitIterator($pages);
Is there a method to check if results are empty?