Skip to content

Commit

Permalink
Fix total for elasticsearch 7 (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored May 19, 2021
1 parent 9682a64 commit 4389877
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Search/Adapter/ElasticSearchAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ public function search(SearchQuery $searchQuery)
$hits[] = $hit;
}

return new SearchResult($hits, $res['hits']['total']);
$total = isset($res['hits']['total']['value']) ? $res['hits']['total']['value'] : $res['hits']['total'];

return new SearchResult($hits, (int) $total);
}

public function getStatus()
Expand Down

0 comments on commit 4389877

Please sign in to comment.