+ if (!empty($aResults)) {
+ $aSplitResults = Result::splitResults($aResults);
+ Debug::printVar('Split results', $aSplitResults);
+ if ($iGroupLoop <= 4 && empty($aSplitResults['tail'])
+ && reset($aSplitResults['head'])->iResultRank > 0) {
+ // Haven't found an exact match for the query yet.
+ // Therefore add result from the next group level.
+ $aNextResults = $aSplitResults['head'];
+ foreach ($aNextResults as $oRes) {
+ $oRes->iResultRank--;
+ }
+ $aResults = array();
+ } else {
+ $aResults = $aSplitResults['head'];
+ }
+ }
+