Skip to content

Commit 5280016

Browse files
georgringerdkd-kaehm
authored andcommitted
[BUGFIX] Fix notice exception in ScoreCalculationService
Fix exception ``` Exception: PHP Warning: Undefined array key 0 in /var/www/html/vendor/apache-solr-for-typo3/solr/Classes/Domain/Search/Score/ScoreCalculationService.php line 101, in file /var/www/html/vendor/typo3/cms-core/Classes/Error/ErrorHandler.php:141 - {"exception":"TYPO3\\CMS\\Core\\Error\\Exception: PHP Warning: Undefined array key 0 in /var/www/html/vendor/apache-solr-for-typo3/solr/Classes/Domain/Search/Score/ScoreCalculationService.php line 101 ``` Ports: TYPO3-Solr#4253
1 parent fca9069 commit 5280016

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Domain/Search/Score/ScoreCalculationService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function parseScores(string $debugData, string $queryFields): array
9898
$pattern = '/' . preg_quote($field, '/') . '\^([\d.]*)/';
9999
$boostMatches = [];
100100
preg_match_all($pattern, $queryFields, $boostMatches);
101-
$boost = (float)$boostMatches[1][0];
101+
$boost = (float)($boostMatches[1][0] ?? 0);
102102
$highScores[$field] = new Score($boost, $field, $currentScoreValue, $searchTerm);
103103
}
104104
}

0 commit comments

Comments
 (0)