From: Sarah Hoffmann Date: Sat, 10 May 2014 17:41:11 +0000 (+0200) Subject: normalize house numbers in placex when searching X-Git-Tag: v2.3.0~34 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/defb809b834ba2cd8ee8025fc829f16511855961 normalize house numbers in placex when searching --- diff --git a/lib/Geocode.php b/lib/Geocode.php index e1cb9b1a..7563a26d 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1343,8 +1343,8 @@ $sPlaceIDs = join(',',$aPlaceIDs); // Now they are indexed look for a house attached to a street we found - $sHouseNumberRegex = '\\\\m'.str_replace(' ','[-,/ ]',$aSearch['sHouseNumber']).'\\\\M'; - $sSQL = "select place_id from placex where parent_place_id in (".$sPlaceIDs.") and housenumber ~* E'".$sHouseNumberRegex."'"; + $sHouseNumberRegex = '\\\\m'.$aSearch['sHouseNumber'].'\\\\M'; + $sSQL = "select place_id from placex where parent_place_id in (".$sPlaceIDs.") and transliteration(housenumber) ~* E'".$sHouseNumberRegex."'"; if (sizeof($this->aExcludePlaceIDs)) { $sSQL .= " and place_id not in (".join(',',$this->aExcludePlaceIDs).")";