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 ? Link to comment https://forums.phpfreaks.com/topic/117507-solved-fulltext-search-for-persian-arabic-words/ 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... Link to comment https://forums.phpfreaks.com/topic/117507-solved-fulltext-search-for-persian-arabic-words/#findComment-604825 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) Link to comment https://forums.phpfreaks.com/topic/117507-solved-fulltext-search-for-persian-arabic-words/#findComment-605286 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 Link to comment https://forums.phpfreaks.com/topic/117507-solved-fulltext-search-for-persian-arabic-words/#findComment-605321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.