]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove suggestion code, no longer works
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 8 May 2013 18:23:47 +0000 (20:23 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 8 May 2013 18:23:47 +0000 (20:23 +0200)
lib/lib.php
settings/settings.php
website/search.php

index 96d2c048fcae7d2b91ca2224a9b55805dcd335e8..1517b317102502d75b175ee39949c96af8ce9434 100644 (file)
        }
 
 
-       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();
index f2cdf9187d7a373ce6262d07229e73a17941915a..9b4320e86d6b99e1d99f4ff67ec3e7ad04d53412 100644 (file)
@@ -64,8 +64,6 @@
        @define('CONST_Search_AreaPolygons_Enabled', true);
        @define('CONST_Search_AreaPolygons', true);
 
-       @define('CONST_Suggestions_Enabled', false);
-
        @define('CONST_Search_TryDroppedAddressTerms', false);
        @define('CONST_Search_NameOnlySearchFrequencyThreshold', false);
 
index 3b0d6ffba80051fc4e5484a3afa6743657fe18fd..dc6b01e444051c53a849a2cea2fa4b7a2f9b81b5 100755 (executable)
@@ -17,7 +17,6 @@
        $aSearchResults = array();
        $aExcludePlaceIDs = array();
        $sCountryCodesSQL = false;
-       $sSuggestion = $sSuggestionURL = false;
        $bDeDupe = isset($_GET['dedupe'])?(bool)$_GET['dedupe']:true;
        $bReverseInPlan = false;
        $iFinalLimit = isset($_GET['limit'])?(int)$_GET['limit']:10;
                                }
                                if (CONST_Debug) var_Dump($aPhrases, $aValidTokens);
 
-                               $aSuggestion = array();
-                               $bSuggestion = false;
-                               if (CONST_Suggestions_Enabled)
-                               {
-                                       foreach($aPhrases as $iPhrase => $aPhrase)
-                                       {
-                                               if (!isset($aValidTokens[' '.$aPhrase['wordsets'][0][0]]))
-                                               {
-                                                       $sQuotedPhrase = getDBQuoted(' '.$aPhrase['wordsets'][0][0]);
-                                                       $aSuggestionWords = getWordSuggestions($oDB, $aPhrase['wordsets'][0][0]);
-                                                       $aRow = $aSuggestionWords[0];
-                                                       if ($aRow && $aRow['word'])
-                                                       {
-                                                               $aSuggestion[] = $aRow['word'];
-                                                               $bSuggestion = true;
-                                                       }
-                                                       else
-                                                       {
-                                                               $aSuggestion[] = $aPhrase['string'];
-                                                       }
-                                               }
-                                               else
-                                               {
-                                                       $aSuggestion[] = $aPhrase['string'];
-                                               }
-                                       }
-                               }
-                               if ($bSuggestion) $sSuggestion = join(', ',$aSuggestion);
-
                                // Try and calculate GB postcodes we might be missing
                                foreach($aTokens as $sToken)
                                {
        if ($bShowAddressDetails) $sMoreURL .= '&addressdetails=1';
        if (isset($_GET['viewbox']) && $_GET['viewbox']) $sMoreURL .= '&viewbox='.urlencode($_GET['viewbox']);
        if (isset($_GET['nearlat']) && isset($_GET['nearlon'])) $sMoreURL .= '&nearlat='.(float)$_GET['nearlat'].'&nearlon='.(float)$_GET['nearlon'];
-       if ($sSuggestion)
-       {
-               $sSuggestionURL = $sMoreURL.'&q='.urlencode($sSuggestion);
-       }
        $sMoreURL .= '&q='.urlencode($sQuery);
 
        if (CONST_Debug) exit;