paliword_sc_pre.php 975 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. //全文搜索 预查询
  3. require_once '../path.php';
  4. require_once '../public/casesuf.inc';
  5. require_once '../public/union.inc';
  6. require_once "../public/_pdo.php";
  7. require_once "../public/function.php";
  8. require_once "../search/word_function.php";
  9. $word=mb_strtolower($_GET["key"],'UTF-8');
  10. $arrWordList = str_getcsv($word," ");
  11. $searching=$arrWordList[count($arrWordList)-1];
  12. $dbfile = _FILE_DB_WORD_INDEX_;
  13. PDO_Connect("sqlite:".$dbfile);
  14. if(count($arrWordList)>1){
  15. //echo "<div>";
  16. foreach($arrWordList as $oneword){
  17. //echo $oneword."+";
  18. }
  19. }
  20. else{
  21. $query = "SELECT word,word_en,count,bold FROM wordindex WHERE word_en like ? OR word like ? limit 0,20";
  22. $Fetch = PDO_FetchAll($query,array("{$searching}%","{$searching}%"));
  23. if(count($Fetch)<10){
  24. $Fetch1 = PDO_FetchAll($query,array("%{$searching}%","%{$searching}%"));
  25. foreach ($Fetch1 as $key => $value) {
  26. #
  27. $Fetch[] = $value;
  28. }
  29. }
  30. echo json_encode($Fetch,JSON_UNESCAPED_UNICODE);
  31. }
  32. ?>