Răsfoiți Sursa

两个词的全文搜索高亮结果改为显示整个段落文本

visuddhinanda 4 ani în urmă
părinte
comite
9c1ddb1f8a
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      app/search/paliword_sc.php

+ 3 - 3
app/search/paliword_sc.php

@@ -65,7 +65,7 @@ if (count($arrWordList) > 1) {
     AS rank,
     ts_headline('pali', content,
                  websearch_to_tsquery('pali', ?),
-                 'StartSel = <highlight>, StopSel = </highlight>')
+                 'StartSel = <highlight>, StopSel = </highlight>,MaxWords=3500, MinWords=3500,HighlightAll=TRUE')
     AS highlight,
     book,paragraph,content 
     FROM fts_texts
@@ -75,7 +75,7 @@ if (count($arrWordList) > 1) {
         full_text_search_weighted_unaccent
         @@ websearch_to_tsquery('pali_unaccent', ?)
     ORDER BY rank DESC
-    LIMIT 20;";
+    LIMIT 40;";
     $Fetch1 = PDO_FetchAll($query, array($word, $word, $word, $word, $word));    
     foreach ($Fetch1 as $key => $value) {
         # code...
@@ -86,7 +86,7 @@ if (count($arrWordList) > 1) {
         $newRecode["palitext"] = $value["content"];
         $newRecode["highlight"] = $value["highlight"];
         $newRecode["keyword"] = $arrWordList;
-        $newRecode["wt"] = $value["rank"];;
+        $newRecode["wt"] = $value["rank"];
         $out_data[] = $newRecode;
     }
 	$result["time"][] = array("event" => "fts精确匹配结束", "time" => microtime(true)-$_start);