Merge pull request #860 from kayue/patch-1
Count the number of results for the query directly
This commit is contained in:
commit
4451bd07c6
|
@ -121,7 +121,7 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface
|
||||||
public function getTotalHits($genuineTotal = false)
|
public function getTotalHits($genuineTotal = false)
|
||||||
{
|
{
|
||||||
if (! isset($this->totalHits)) {
|
if (! isset($this->totalHits)) {
|
||||||
$this->totalHits = $this->searchable->search($this->query)->getTotalHits();
|
$this->totalHits = $this->searchable->count($this->query);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->query->hasParam('size') && !$genuineTotal
|
return $this->query->hasParam('size') && !$genuineTotal
|
||||||
|
|
Loading…
Reference in a new issue