diff --git a/lib/Core/Pagination/Pagerfanta/BaseAdapter.php b/lib/Core/Pagination/Pagerfanta/BaseAdapter.php index 5665f0db..5e324479 100644 --- a/lib/Core/Pagination/Pagerfanta/BaseAdapter.php +++ b/lib/Core/Pagination/Pagerfanta/BaseAdapter.php @@ -135,7 +135,11 @@ private function setExtraInfo(SearchResult $searchResult) $this->facets = $searchResult->facets; $this->maxScore = $searchResult->maxScore; $this->nbResults = $searchResult->totalCount; - $this->suggestion = $searchResult instanceof ExtraSearchResult ? $searchResult->suggestion : new Suggestion([]); + $this->suggestion = new Suggestion([]); + + if ($searchResult instanceof ExtraSearchResult && $searchResult->suggestion instanceof Suggestion) { + $this->suggestion = $searchResult->suggestion; + } $this->isExtraInfoInitialized = true; }