fraser5002 Posted January 10, 2011 Share Posted January 10, 2011 Hi i am tryign to get to grips with FULLTEXT in MySQL to improve the search facilities on my site. $searchterm = 'Tomate' $query= SELECT * FROM testtable WHERE MATCH(vegetable) AGAINST($searchterm); I have the above code to to mess about to try understand . My table has a field called vegetable full of vegetables funnily enough, I have set this field to fulltext index My query is not returning any results for " Tomate" only if i use the proper word "Tomato" I thought the point with FULLTEXT is it would return "similar" results. DO i have the wrong end of the stick here? How do i use FULLTEXT to return searches of misspelt words? Quote Link to comment https://forums.phpfreaks.com/topic/223988-help-with-fulltext/ Share on other sites More sharing options...
suresh_kamrushi Posted January 12, 2011 Share Posted January 12, 2011 i just gone through MySql manual for Fulltext and find the below code CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body)); INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...'), ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('database'); When i run the query it will give me the result. But when i run that query like : SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('datab'); i does not show me any result. Hence we can conculde that,in Fulltext search we can search complete word and not "part" of word. Quote Link to comment https://forums.phpfreaks.com/topic/223988-help-with-fulltext/#findComment-1158275 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.