]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
ignore frequent partial search terms
[nominatim.git] / website / search.php
index 77892f238883e920549a7134a70c52832bd314c4..1d877e77ebfdf76564e1d8b0cab03bc47cb06fa1 100755 (executable)
                        // Check which tokens we have, get the ID numbers                       
                        $sSQL = 'select word_id,word_token, word, class, type, location, country_code, operator';
                        $sSQL .= ' from word where word_token in ('.join(',',array_map("getDBQuoted",$aTokens)).')';
+                       $sSQL .= ' and search_name_count < '.CONST_Max_Word_Frequency;
                        $sSQL .= ' and (class is null or class not in (\'highway\'))';
 //                     $sSQL .= ' group by word_token, word, class, type, location, country_code';
 
                {
                        if (stripos($sAddress, $sWord)!==false) $iCountWords++;
                }
-               $aResult['importance'] = $aResult['importance'] + $iCountWords;
+               $aResult['importance'] = $aResult['importance'] + ($iCountWords*0.1); // 0.1 is a completely arbitrary number but something in the range 0.1 to 0.5 would seem right
 
 //if (CONST_Debug) var_dump($aResult['class'].':'.$aResult['type'].':'.$aResult['admin_level']);
 /*