]> git.openstreetmap.org Git - nominatim.git/commitdiff
normalize house numbers in placex when searching
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 10 May 2014 17:41:11 +0000 (19:41 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 10 May 2014 17:41:11 +0000 (19:41 +0200)
lib/Geocode.php

index e1cb9b1aef839d8e5b1485801cb47f95b5affeb1..7563a26d54e326691ccb982b39124832abcf23dd 100644 (file)
                                                                $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).")";