]> 91.132.146.200 Git - insipid.git/commitdiff
fulltext search is not as good as it should be.
authorBanana <banana@optimus.de>
Wed, 4 Jan 2017 14:52:10 +0000 (15:52 +0100)
committerBanana <banana@optimus.de>
Wed, 4 Jan 2017 14:52:10 +0000 (15:52 +0100)
http://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html

webroot/view/home.inc.php

index b5f14562e7c8518f3ae41c7bc9858b9fba9011c7..2c50b2f840ea6e36b1751ec748592503212ef95c 100644 (file)
@@ -62,10 +62,10 @@ if(isset($_POST['data']) && !empty($_POST['data']) && isset($_POST['submitsearch
         $searchValue = str_replace('"', "", $searchValue);
 
         $queryStr = "SELECT *, MATCH (search)
-                            AGAINST ('*".$DB->real_escape_string($searchValue)."*' IN BOOLEAN MODE) AS score
+                            AGAINST ('".$DB->real_escape_string($searchValue)."*' IN BOOLEAN MODE) AS score
                         FROM `".DB_PREFIX."_link`
                         WHERE MATCH (search)
-                            AGAINST ('*".$DB->real_escape_string($searchValue)."*' IN BOOLEAN MODE)
+                            AGAINST ('".$DB->real_escape_string($searchValue)."*' IN BOOLEAN MODE)
                         ORDER BY score DESC";
     }
     else {
@@ -73,6 +73,8 @@ if(isset($_POST['data']) && !empty($_POST['data']) && isset($_POST['submitsearch
         $submitFeedback['status'] = 'error';
     }
 
+    var_dump($queryStr);
+
     if(!empty($queryStr)) {
         $query = $DB->query($queryStr);
         if(!empty($query) && $query->num_rows > 0) {