I have following mysql table structure : http://sqlfiddle.com/#!9/d36f69/2
CREATE TABLE IF NOT EXISTS `subcat` (
`id` int(11) DEFAULT '0',
`subCatName` varchar(255) NOT NULL,
`Keywords` varchar(255) DEFAULT NULL,
KEY `Keywords` (`Keywords`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Following are two records :
id subCatName Keywords
1 Plastic baby toys, bag, basket
2 Metal metal finish, box cover
Now i want to search record using keywords field. Suppose i enter
"baby toys products"
Then you can see that in keywords field there is words "baby toys". So that subcat record should be return in search query. Here you can see that "products" is not matched in keywords but only two words are matched. Then still first matched record should return in result.
How can we do it ?