Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit 2eb45b1

Browse files
author
ivan.babenko
committed
Fixed pagination
1 parent 97474c6 commit 2eb45b1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/ElasticEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public function map(Builder $builder, $results, $model)
337337
*/
338338
public function getTotalCount($results)
339339
{
340-
return $results['hits']['total'];
340+
return $results['hits']['total']['value'];
341341
}
342342

343343
/**

tests/ElasticEngineTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,10 @@ public function testGetTotalCount()
444444
{
445445
$results = [
446446
'hits' => [
447-
'total' => 100,
447+
'total' => [
448+
'value' => 100,
449+
'relation' => 'eq',
450+
],
448451
],
449452
];
450453

0 commit comments

Comments
 (0)