X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2ba9c11dd05e72ff2de9743df59759c41655ff9d..f0f6fcf256c83176dbcda0d0fd4fec977ea8a0ad:/lib/Geocode.php?ds=sidebyside diff --git a/lib/Geocode.php b/lib/Geocode.php index 83eb647a..e6e6e3eb 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1331,11 +1331,11 @@ { $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"; }