From defb809b834ba2cd8ee8025fc829f16511855961 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 10 May 2014 19:41:11 +0200 Subject: [PATCH] normalize house numbers in placex when searching --- lib/Geocode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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).")";