- if (!empty($aHnResults)) {
- foreach ($aHnResults as $oRes) {
- $aResults[$oRes->iId] = $oRes;
+ // Downgrade the rank of the street results, they are missing
+ // the housenumber. Also drop POI places (rank 30) here, they
+ // cannot be a parent place and therefore must not be shown
+ // as a result for a search with a missing housenumber.
+ foreach ($aResults as $oRes) {
+ if ($oRes->iAddressRank < 28) {
+ if ($oRes->iAddressRank >= 26) {
+ $oRes->iResultRank++;
+ } else {
+ $oRes->iResultRank += 2;
+ }
+ $aHnResults[$oRes->iId] = $oRes;