so I am trying to make a simple search engine, that allows a user to search username, email, firstname and lastname.
However everytime I run the following it only returns russell.harrower instead of both russellharrower and russell.harrower
SELECT *, MATCH(username) AGAINST ('russell') as score FROMuser_infoWHERE MATCH(username) AGAINST ('russell')
I am not sure if i need to put a like status in there or what, so thought i would ask.
I want it to order the whole sql by the score.
Did you try using asterisk (wildcard) in boolean mode?
http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html
http://www.databasejournal.com/features/mysql/article.php/1587371/Using-Fulltext-Indexes-in-MySQL—Part-2-Boolean-searches.htm
http://www.joedolson.com/boolean-query-in-mysql.php
/edit: don’t use LIKE, especially with % in front of a phrase, it’s veeery slow