Jump to content

[SOLVED] FULLTEXT search for persian (arabic) words


asmith

Recommended Posts

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 ?

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)

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.