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 ?

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.