X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9c6d30ca956849bab8db239627dfdf4f9eeec6bb..70f0d6ba8bc0e8c4115155b27a36e8a9a037d727:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index 1588dff5..32b50580 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -892,6 +892,9 @@ if ($aSearch['sHouseNumber'] === '') { $aSearch['sHouseNumber'] = $sToken; + // sanity check: if the housenumber is not mainly made + // up of numbers, add a penalty + if (preg_match_all("/[^0-9]/", $sToken, $aMatches) > 2) $aSearch['iSearchRank']++; if ($aSearch['iSearchRank'] < $this->iMaxRank) $aNewWordsetSearches[] = $aSearch; /* // Fall back to not searching for this item (better than nothing)