I also found the same answers, so I set the two extra fields up as Indexes in the database. The script worked, but actually the results were much worse.
Final outcome? I reverted back to ’partial’ mode and slightly amended my ’partial’ SQL statement to something more specific for this job.
If however you need a quick way to get the script to work in ’relevance’ mode, then you simply open up assets/snippets/AjaxSearch/includes/AjaxSearch.inc.php and look for the following line:
$sql .= "FROM $tbl_sc" . $tbl_sql . " sc WHERE ";
Replace with:
$sql .= "FROM $tbl_sc sc" . $tbl_sql . " WHERE ";
(This will move the table alias to the correct place).
And then find the line:
$sql .= "MATCH (sc.pagetitle, sc.longtitle, sc.introtext, sc.description, sc.content, stc.value) AGAINST ('{$searchTerm}') AND ";
And replace it with:
$sql .= "MATCH (sc.pagetitle, sc.description, sc.content) AGAINST ('{$searchTerm}') AND ";
Just to explain: in the database (within the ’site_content’ table) the fields ’longtitle’ and ’introtext’ are not indexed using FULLTEXT so cannot be searched using the SQL function MATCH(). This is my understanding anyway!!!
Hope that helps.