downgrade housenumbers without numbers

Fixes #1312.
This commit is contained in:
Sarah Hoffmann 2019-02-24 14:39:14 +01:00
parent 16794a84de
commit 8f0c628310

View File

@ -237,7 +237,8 @@ class SearchDescription
$oSearch->sHouseNumber = $oSearchTerm->sToken;
// sanity check: if the housenumber is not mainly made
// up of numbers, add a penalty
if (preg_match_all('/[^0-9]/', $oSearch->sHouseNumber, $aMatches) > 2) {
if (preg_match('/\\d/', $oSearch->sHouseNumber) === 0
|| preg_match_all('/[^0-9]/', $oSearch->sHouseNumber, $aMatches) > 2) {
$oSearch->iSearchRank++;
}
if (empty($oSearchTerm->iId)) {