Skip to content

Commit

Permalink
fix: added check for docScores id in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
tiller1010 committed May 24, 2024
1 parent 9a06652 commit e102b33
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/SearchControllerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ public function getSearchResults(string $search)
return abs($a) < abs($b) ? 1 : -1;
});
foreach ($docScores as $id => $score) {
$parts = explode("_", $id);
if ($obj = $classlist[$parts[0]]::get()->byID($parts[1])) {
$results->push($obj);
if ($id) {
$parts = explode("_", $id);
if ($obj = $classlist[$parts[0]]::get()->byID($parts[1])) {
$results->push($obj);
}
}
}
} else {
Expand Down

0 comments on commit e102b33

Please sign in to comment.