Skip to content

Commit 4451bd0

Browse files
committed
Merge pull request #860 from kayue/patch-1
Count the number of results for the query directly
2 parents 1f8a330 + e71ec4a commit 4451bd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Paginator/RawPaginatorAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function getResults($offset, $itemCountPerPage)
121121
public function getTotalHits($genuineTotal = false)
122122
{
123123
if (! isset($this->totalHits)) {
124-
$this->totalHits = $this->searchable->search($this->query)->getTotalHits();
124+
$this->totalHits = $this->searchable->count($this->query);
125125
}
126126

127127
return $this->query->hasParam('size') && !$genuineTotal

0 commit comments

Comments
 (0)