Results 1 to 1 of 1
Jun 30, 2009, 00:32 #1
- Join Date
- Jun 2009
- 0 Post(s)
- 0 Thread(s)
Relevance Rankings for Full Text and Boolean Searches
I am trying to apply ranking to the output of my search result based on the relevance of the searchterm & record in database.
when I run the below code..there was a query error
$searchterm=$db->escapeString($_GET['searchterm']); $result = $db->query("SELECT subject, learningArea, ability, MATCH(subject, learningArea, ability) AGAINST('$searchterm') AS relevance FROM lesson IN BOOLEAN MODE)");
I have tried this as well
$result=$db->query("SELECT lessonID, subject, learningArea, ability FROM lesson WHERE MATCH (subject,learningArea,ability)
AGAINST ('" . stripslashes (str_replace (""", "\"", ($_GET['searchterm']))) . "' IN BOOLEAN MODE) ");
Many thanks for your help.