X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/db719d489fc7256ff26ce4b4bf7404e1429fff17..f0f6fcf256c83176dbcda0d0fd4fec977ea8a0ad:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index 61ac834b..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 ".$aSearch['sHouseNumber'].">=startnumber and ".$aSearch['sHouseNumber']."<=endnumber limit 1)"; + $aOrder[0] .= " and ".intval($aSearch['sHouseNumber']).">=startnumber and ".intval($aSearch['sHouseNumber'])."<=endnumber limit 1))"; $aOrder[0] .= " desc"; }