I noticed that searches for a particular word wasn’t working on our user search, I’ve narrowed the problem down to this small example.
If you create a test table like this:
CREATE TABLE `names` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
insert into `names`(`id`,`name`) values (1,'Joseph');
insert into `names`(`id`,`name`) values (2,'Dick');
insert into `names`(`id`,`name`) values (3,'Rather');
insert into `names`(`id`,`name`) values (4,'Steven');
insert into `names`(`id`,`name`) values (5,'Anna');
And perform this search:
SELECT * FROM `names` WHERE MATCH(NAME) AGAINST ('+rather* ' IN BOOLEAN MODE);
You will see that there are no results.
However substituting ‘rather’ for any of the other names in the table works fine…
What’s wrong with ‘Rather’???
It’s mysql version 5.5.8.
Any help greatly appreciated… I really have no idea on this one!!
Thanks.
ratheris a MySQL stopword. You cannot full text search for it by default.To work around that, you can disable stopwords by setting the ft_stopword_file system variable to the empty string.