I am having a problem with boolean searching, firstly I thought it was something wrong with my database/table but then i tried creating following sample table with 1 column and sample values and result is same, it successfully runs for some words and fails for others, any ideas?
Queries that run successfully:
SELECT * FROM `temp` WHERE (match (txt) against ('develo*' IN BOOLEAN MODE)>0 )
SELECT * FROM `temp` WHERE (match (txt) against ('devel*' IN BOOLEAN MODE)>0 )
SELECT * FROM `temp` WHERE (match (txt) against ('senio*' IN BOOLEAN MODE)>0 )
But when I try doing similar search against words ‘second’ or ‘third’, it fails
SELECT * FROM `temp` WHERE (match (txt) against ('secon*' IN BOOLEAN MODE)>0 )
SELECT * FROM `temp` WHERE (match (txt) against ('third*' IN BOOLEAN MODE)>0 )
— Following is the sample table and values —–
CREATE TABLE IF NOT EXISTS `temp` (
`txt` varchar(30) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `temp`
--
INSERT INTO `temp` (`txt`) VALUES
('developer'),
('Developer'),
('Developer senior'),
('senior developer'),
('second job'),
('job second'),
('third'),
('third job'),
('job third');
As stopwords list is applied in BOOLEAN MODE match, words
secondandthirdare just ignored by the engine.You can override the default stopwords list with your own, as described here: