(mysql 5.1.36)
I am trying to find out why when I search for the word “three” in a full-text query, I get no results. I get the same result if the word “three” is the only text in the field or is part of a sentence.
Easy to reproduce:
CREATE TABLE `test`( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT , `word` TEXT NOT NULL , PRIMARY KEY (`id`) ); ALTER TABLE `test` ADD FULLTEXT `NewIndex1` (`word`); INSERT INTO `test`(`id`,`word`) VALUES ( NULL,'three'); INSERT INTO `test`(`id`,`word`) VALUES ( NULL,'thorn');
Then run the following queries:
SELECT * FROM test WHERE word='three';
result = [1, 'three']
SELECT word FROM test WHERE MATCH(word) AGAINST ('three*' IN BOOLEAN MODE );
result = []
SELECT word FROM test WHERE MATCH(word) AGAINST ('three' IN BOOLEAN MODE);
result = []
SELECT word FROM test WHERE MATCH(word) AGAINST ('thre*' IN BOOLEAN MODE );
result = []
SELECT word FROM test WHERE MATCH(word) AGAINST ('thorn*' IN BOOLEAN MODE )
result = [2, 'thorn']
SELECT word FROM test WHERE MATCH(word) AGAINST ('thorn' IN BOOLEAN MODE)
result = [2, 'thorn']
SELECT word FROM test WHERE MATCH(word) AGAINST ('thor*' IN BOOLEAN MODE)
result = [2, 'thorn']
Why does a full-text search for three not return results?
source share