From: Sarah Hoffmann Date: Thu, 1 May 2014 07:26:07 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~537 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/70f0d6ba8bc0e8c4115155b27a36e8a9a037d727?hp=9c6d30ca956849bab8db239627dfdf4f9eeec6bb Merge remote-tracking branch 'upstream/master' --- 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)