]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
update comments and formatting
[nominatim.git] / lib / Geocode.php
index 83eb647aaf0a1c96e2623028771293659e43a459..e6e6e3eb7ec1208cd69a3ce264f3d2902f8db0c9 100644 (file)
                                                        {
                                                                $sHouseNumberRegex = '\\\\m'.$aSearch['sHouseNumber'].'\\\\M';
                                 $aOrder[] = "";
-                                                               $aOrder[0] = " exists(select place_id from placex where parent_place_id = search_name.place_id";
+                                                               $aOrder[0] = " (exists(select place_id from placex where parent_place_id = search_name.place_id";
                                 $aOrder[0] .= " and transliteration(housenumber) ~* E'".$sHouseNumberRegex."' limit 1) ";
                                                                // also housenumbers from interpolation lines table are needed
                                                                $aOrder[0] .= " or exists(select place_id from location_property_osmline where parent_place_id = search_name.place_id";
-                                $aOrder[0] .= " and ".intval($aSearch['sHouseNumber']).">=startnumber and ".intval($aSearch['sHouseNumber'])."<=endnumber limit 1)";
+                                $aOrder[0] .= " and ".intval($aSearch['sHouseNumber']).">=startnumber and ".intval($aSearch['sHouseNumber'])."<=endnumber limit 1))";
                                                                $aOrder[0] .= " desc";
                                                        }