X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6f946360c4fe32b9d28da92d8b000315580471dc..4c4798959edd339cad918250ad5698d6ca7414ec:/website/search.php diff --git a/website/search.php b/website/search.php index 2ee07e3c..3a9295c2 100755 --- a/website/search.php +++ b/website/search.php @@ -106,6 +106,12 @@ // Hack to make it handle "new york, ny" (and variants) correctly $sQuery = str_ireplace(array('New York, ny','new york, new york', 'New York ny','new york new york'), 'new york city, ny', $sQuery); + if (isset($aLangPrefOrder['name:en'])) + { + $sQuery = preg_replace('/\\bil\\b/','illinois', $sQuery); + $sQuery = preg_replace('/\\bal\\b/','alabama', $sQuery); + $sQuery = preg_replace('/\\bla\\b/','louisiana', $sQuery); + } // If we have a view box create the SQL // Small is the actual view box, Large is double (on each axis) that @@ -664,7 +670,9 @@ { if (4 >= $iMinAddressRank && 4 <= $iMaxAddressRank) { - $sSQL = "select place_id from placex where country_code='".$aSearch['sCountryCode']."' and rank_search = 4 order by st_area(geometry) desc limit 1"; + $sSQL = "select place_id from placex where country_code='".$aSearch['sCountryCode']."' and rank_search = 4"; + if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)"; + $sSQL .= " order by st_area(geometry) desc limit 1"; $aPlaceIDs = $oDB->getCol($sSQL); } }