From: Banana Date: Wed, 4 Jan 2017 14:52:10 +0000 (+0100) Subject: fulltext search is not as good as it should be. X-Git-Tag: 2.1-alpha-2019-0-29~49 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=1fe30930328a1e8bad3be9efad2ee8fa85f1e944;p=insipid.git fulltext search is not as good as it should be. http://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html --- diff --git a/webroot/view/home.inc.php b/webroot/view/home.inc.php index b5f1456..2c50b2f 100644 --- a/webroot/view/home.inc.php +++ b/webroot/view/home.inc.php @@ -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) {