We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd83c0b commit cff5fd8Copy full SHA for cff5fd8
1 file changed
src/Response/ResultMapper.php
@@ -239,10 +239,17 @@ public function mapStats(
239
array $elasticSearchResponse
240
) : Stats
241
{
242
+ $total = 0;
243
+ if (\is_int($elasticSearchResponse['hits']['total'])) {
244
+ $total = $elasticSearchResponse['hits']['total'];
245
+
246
+ } elseif (isset($elasticSearchResponse['hits']['total']['value'])) {
247
+ $elasticSearchResponse['hits']['total']['value'];
248
+ }
249
return new Stats(
250
$elasticSearchResponse['took'],
251
$elasticSearchResponse['timed_out'],
- $elasticSearchResponse['hits']['total']
252
+ $total
253
);
254
}
255
0 commit comments