X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c20103a46171b93960139709ef88071dcc566830..95d50f35d046e2ae540eadf7ab9af40ac119e06f:/website/search.php diff --git a/website/search.php b/website/search.php index 2e235ee5..d6007ef5 100755 --- a/website/search.php +++ b/website/search.php @@ -84,7 +84,7 @@ $hLog = logStart($oDB, 'search', $sQuery, $aLangPrefOrder); // 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, new york', $sQuery); + $sQuery = str_ireplace(array('New York, ny','new york, new york', 'New York ny','new york new york'), 'new york city, ny', $sQuery); // If we have a view box create the SQL // Small is the actual view box, Large is double (on each axis) that @@ -452,7 +452,7 @@ { if (sizeof($aSearch['aName'])) { - if (!isset($aValidTokens[$sToken]) || strlen($sToken) < 4) + if (!isset($aValidTokens[$sToken]) || strlen($sToken) < 4 || strpos($sToken, ' ') !== false) { $aSearch['aAddress'][$aSearchTerm['word_id']] = $aSearchTerm['word_id']; } @@ -470,14 +470,14 @@ } } } - if (isset($aValidTokens[$sToken]) && strlen($sToken) >= 4) + if (isset($aValidTokens[$sToken])) { // Allow searching for a word - but at extra cost foreach($aValidTokens[$sToken] as $aSearchTerm) { //var_Dump('