X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ed65ad2f5abc5915c6b6ce4e8fdb876979cf151b..70f0d6ba8bc0e8c4115155b27a36e8a9a037d727:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index 016fc101..32b50580 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -485,8 +485,6 @@ $sCountryCodesSQL = join(',', array_map('addQuotes', $this->aCountryCodes)); } - // 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', $this->sQuery); $sQuery = $this->sQuery; // Conflicts between US state abreviations and various words for 'the' in different languages @@ -498,7 +496,7 @@ } // View Box SQL - $sViewboxCentreSQL; + $sViewboxCentreSQL = false; $bBoundingBoxSearch = false; if ($this->aViewBox) { @@ -894,6 +892,9 @@ if ($aSearch['sHouseNumber'] === '') { $aSearch['sHouseNumber'] = $sToken; + // sanity check: if the housenumber is not mainly made + // up of numbers, add a penalty + if (preg_match_all("/[^0-9]/", $sToken, $aMatches) > 2) $aSearch['iSearchRank']++; if ($aSearch['iSearchRank'] < $this->iMaxRank) $aNewWordsetSearches[] = $aSearch; /* // Fall back to not searching for this item (better than nothing)