View Full Version : mysql full text
AN-net
02-13-2005, 04:48 PM
ok its giving me the error can not find fulltext index in column list. but in phpmyadmin its listed under indexes as fulltext.
here is my code:
$query['where'] = "MATCH (news.news_title,news.news_text) AGAINST ('".addslashes($searchfor)."') AND news_active=1";
that is my where query
also does it automatically order them by relevancy and how do i change those relevancy values to percentages?
WhSox21
02-16-2005, 03:54 AM
When MATCH() is used in a WHERE clause, as in the preceding example, the rows returned are automatically sorted with the highest relevance first.To change it to percentages just add the code to the SELECT list along with the WHERE clause. It also states that this causes no extra overhead as MySQL notices the two MATCH() functions and only does the fulltext search once.
Source:
http://dev.mysql.com/doc/mysql/en/fulltext-search.html
AN-net
02-16-2005, 11:57 PM
thanks but why doesn't it perform the search if i have the indexes and i have optimized/repaired the table afterwards...
AN-net
02-18-2005, 06:30 PM
anyone??
sabret00the
02-18-2005, 07:30 PM
can't you use $query['where'] = "WHERE (news.news_title LIKE '%" . addslashes($searchfor) . "%' OR news.news_text LIKE '%" . addslashes($searchfor) . "%') AND new_active=1;
AN-net
02-18-2005, 07:56 PM
yes but full text is more accurate and retrieves better results;)
sabret00the
02-18-2005, 08:13 PM
but it works :P
nah seriously i have no idea then :(
AN-net
02-18-2005, 10:03 PM
well i am currently using that for my searching but full text would be so much better>_>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.