i have job portal website. I am suing fulltext search for searching user keywords. my table contains job_id, job_content columns When users searches 4 keywords at a time then i need to display mininum 3 words matching results. But i am also getting two words matching results also. I want only the job_content contains atleast 3 search words in that 4 words.
This is the code what i wrote
$jtitle=explode(" ",$_REQUEST['job_title']);
$mch=" (MATCH(t.job_title) AGAINST('+$jtitle[0] +$jtitle[1] +$jtitle[2] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_title) AGAINST('+$jtitle[0] +$jtitle[1] +$jtitle[2]' IN BOOLEAN MODE)
or MATCH(t.job_title) AGAINST('+$jtitle[1] +$jtitle[2] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_title) AGAINST('+$jtitle[0] +$jtitle[1] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_title) AGAINST('+$jtitle[0] +$jtitle[2] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_content) AGAINST('+$jtitle[0] +$jtitle[1] +$jtitle[2] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_content) AGAINST('+$jtitle[0] +$jtitle[1] +$jtitle[1]' IN BOOLEAN MODE)
or MATCH(t.job_content) AGAINST('+$jtitle[1] +$jtitle[2] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_content) AGAINST('+$jtitle[0] +$jtitle[1] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_content) AGAINST('+$jtitle[0] +$jtitle[2] +$jtitle[3]' IN BOOLEAN MODE)
or MATCH(t.job_content) AGAINST('+$jtitle[0] +$jtitle[1] +$jtitle[3]' IN BOOLEAN MODE) )";
$qry=mysql_query(" select * from jobs where 1=1 and $mch ")
i wrote query like this for displaying atleast 3 keywords matching in jb_content or job_title results when user searches 4 words. Problem is i am getting 2 words matching also.
Please help me how to solve this one for getting exact words results