includes/search.php
changeset 335 67bd3121a12e
parent 334 c72b545f1304
child 340 993fb077944f
equal deleted inserted replaced
334:c72b545f1304 335:67bd3121a12e
    73       }
    73       }
    74       $letters = implode('', $letters);
    74       $letters = implode('', $letters);
    75       $words = explode(' ', $letters);
    75       $words = explode(' ', $letters);
    76       foreach($words as $c => $w)
    76       foreach($words as $c => $w)
    77       {
    77       {
    78         if(strlen($w) < 2 || in_array($w, $stopwords))
    78         if(strlen($w) < 2 || in_array($w, $stopwords) || strlen($w) > 63)
    79           unset($words[$c]);
    79           unset($words[$c]);
    80         else
    80         else
    81           $words[$c] = $w;
    81           $words[$c] = $w;
    82       }
    82       }
    83       $words = array_values($words);
    83       $words = array_values($words);
   117  */
   117  */
   118 
   118 
   119 function perform_search($query, &$warnings, $case_sensitive = false, &$word_list)
   119 function perform_search($query, &$warnings, $case_sensitive = false, &$word_list)
   120 {
   120 {
   121   global $db, $session, $paths, $template, $plugins; // Common objects
   121   global $db, $session, $paths, $template, $plugins; // Common objects
       
   122   global $lang;
       
   123   
   122   $warnings = array();
   124   $warnings = array();
   123 
   125 
   124   $query = parse_search_query($query, $warnings);
   126   $query = parse_search_query($query, $warnings);
   125 
   127 
   126   // Segregate search terms containing spaces
   128   // Segregate search terms containing spaces
   527           'page_text' => '',
   529           'page_text' => '',
   528           'page_id' => $page['urlname_nons'],
   530           'page_id' => $page['urlname_nons'],
   529           'namespace' => $page['namespace'],
   531           'namespace' => $page['namespace'],
   530           'score' => $scores[$idstring],
   532           'score' => $scores[$idstring],
   531           'page_length' => 1,
   533           'page_length' => 1,
   532           'page_note' => '[Special page]'
   534           'page_note' => '[' . $lang->get('search_result_tag_special') . ']'
   533         );
   535         );
   534     }
   536     }
   535   }
   537   }
   536   
   538   
   537   //
   539   //