Skip to content

Commit 2e80226

Browse files
Ensure that hitsCount value is consistent
1 parent a1a414e commit 2e80226

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Search/SearchResult.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,18 @@ public function __construct(array $body)
5858
$this->offset = $body['offset'];
5959
$this->limit = $body['limit'];
6060
$this->estimatedTotalHits = $body['estimatedTotalHits'];
61-
$this->hitsCount = \count($body['hits']);
6261
} else {
6362
$this->numberedPagination = true;
6463

6564
$this->hitsPerPage = $body['hitsPerPage'];
6665
$this->page = $body['page'];
6766
$this->totalPages = $body['totalPages'];
6867
$this->totalHits = $body['totalHits'];
69-
$this->hitsCount = $body['totalHits'];
7068
}
7169

7270
$this->semanticHitCount = $body['semanticHitCount'] ?? 0;
7371
$this->hits = $body['hits'] ?? [];
72+
$this->hitsCount = \count($body['hits']);
7473
$this->processingTimeMs = $body['processingTimeMs'];
7574
$this->query = $body['query'];
7675
$this->facetDistribution = $body['facetDistribution'] ?? [];

0 commit comments

Comments
 (0)