X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b4c87a09a194a7d966724ce48ba2d8ef0d044ca0..e5c901e55dad26584a942be77a2ed4939f85e6cd:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index 96d2c048..a4e4aa6c 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -169,7 +169,7 @@ { $aResult = array(array(join(' ',$aWords))); $sFirstToken = ''; - if ($iDepth < 8) { + if ($iDepth < 7) { while(sizeof($aWords) > 1) { $sWord = array_shift($aWords); @@ -785,20 +785,6 @@ } - function getWordSuggestions(&$oDB, $sWord) - { - $sWordQuoted = getDBQuoted(trim($sWord)); - $sSQL = "select *,levenshtein($sWordQuoted,word) from test_token "; - $sSQL .= "where (metaphone = dmetaphone($sWordQuoted) or metaphonealt = dmetaphone($sWordQuoted) or "; - $sSQL .= "metaphone = dmetaphone_alt($sWordQuoted) or metaphonealt = dmetaphone_alt($sWordQuoted)) "; - $sSQL .= "and len between length($sWordQuoted)-2 and length($sWordQuoted)+2 "; - $sSQL .= "and levenshtein($sWordQuoted,word) < 3 "; - $sSQL .= "order by levenshtein($sWordQuoted,word) asc, abs(len - length($sWordQuoted)) asc limit 20"; - $aSimilar = $oDB->getAll($sSQL); - return $aSimilar; - } - - function geocodeReverse($fLat, $fLon, $iZoom=18) { $oDB =& getDB(); @@ -898,7 +884,7 @@ return $iPlaceID; } - function loadStructuredAddressElement(&$aStructuredQuery, &$iMinAddressRank, &$iMaxAddressRank, $aParams, $sKey, $iNewMinAddressRank, $iNewMaxAddressRank) + function loadStructuredAddressElement(&$aStructuredQuery, &$iMinAddressRank, &$iMaxAddressRank, &$aAddressRankList, $aParams, $sKey, $iNewMinAddressRank, $iNewMaxAddressRank, $aItemListValues) { if (!isset($_GET[$sKey])) return false; $sValue = trim($_GET[$sKey]); @@ -909,5 +895,6 @@ $iMinAddressRank = $iNewMinAddressRank; $iMaxAddressRank = $iNewMaxAddressRank; } + if ($aItemListValues) $aAddressRankList = array_merge($aAddressRankList, $aItemListValues); return true; }