asmith Posted July 31, 2008 Share Posted July 31, 2008 hey guys I have a table like this on a site : CREATE TABLE `table_name` ( `id` int( NOT NULL auto_increment, `title` varchar(200) character set latin1 default NULL, `description` text character set latin1, `owner` varchar(50) character set latin1 default NULL, PRIMARY KEY (`id`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `description` (`description`), FULLTEXT KEY `owner` (`owner`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=25259 ; It has about 13,000 rows. and 90 % of the content have been inserted as persian (arabic) characters. like a word "فارسی" but when i look at mysql through mysql query browser or phpmyadmin is show the words like " Ùصلن " (it is not that word) and when i fetch it again and echo it on the page it shows "فارسی" again. (so i assume it is just storeed in database like that, but changes to good shape when using it on the site) Now I want to add a fulltext search to the site. I use this query : SELECT * FROM table_name WHERE MATCH(title,description,owner) AGAINST('$_POST[key]' in boolean mode) this query works perfect for english words. But show no results for persian (arabic) words. How can i fix such thing ? Quote Link to comment Share on other sites More sharing options...
fenway Posted July 31, 2008 Share Posted July 31, 2008 Assuming that everything is UTF-8, there shouldn't be an issue... Quote Link to comment Share on other sites More sharing options...
asmith Posted August 1, 2008 Author Share Posted August 1, 2008 This query is not finding anything : $result = $db->sql_query("SELECT * FROM tablename WHERE MATCH(description) AGAINST('سیستم')") or die(mysql_error()); but this one is working fine : $result = $db->sql_query("SELECT * FROM tablename WHERE description like '%سیستم%'") or die(mysql_error()); Why FULLTEXT search is not working ? :/ (Both queries are working fine for english words) Quote Link to comment Share on other sites More sharing options...
asmith Posted August 1, 2008 Author Share Posted August 1, 2008 I recreated table and changed latin1 to utf-8. All works fine now. Thanks Quote Link to comment 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.