Skip to content

Commit fc89dcd

Browse files
committed
Stats returns number without from and size parameters, so we must count hits that really exits in collection
1 parent 7cf01cf commit fc89dcd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Model/AbstractBaseService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getAllBy(
9696
throw $exception;
9797
}
9898

99-
if ($resultSearch->stats()->total() === 0) {
99+
if ($resultSearch->hits()->count() === 0) {
100100
throw new \Spameri\Elastic\Exception\DocumentNotFound($this->index, $elasticQuery);
101101
}
102102

0 commit comments

Comments
 (0)