From 1fe30930328a1e8bad3be9efad2ee8fa85f1e944 Mon Sep 17 00:00:00 2001 From: Banana Date: Wed, 4 Jan 2017 15:52:10 +0100 Subject: [PATCH] fulltext search is not as good as it should be. http://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html --- webroot/view/home.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) { -- 2.39.5