3 つの列にまたがる全文検索インデックスを作成しようとしていますが、結果が返されるべきだと思われますが、結果が返されません。次の構造とデータを使用して、テストテーブルで問題を再現しました。
CREATE TABLE IF NOT EXISTS `testtable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`link` varchar(255) NOT NULL,
`description` text NOT NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `title` (`title`,`link`,`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
INSERT INTO `testtable` (`id`, `title`, `link`, `description`) VALUES
(1, 'mysql article', 'domain.com/article/1', 'This is an article about MySQL'),
(2, 'some other article', 'domain.com/article/mysql-article', 'This has mysql in the link but not the title'),
(3, 'my super mysql article', 'domain.com/mysql-link', 'the keyword is not in the description'),
(4, 'okay i''m searching for something', 'domain.com', 'and it''s not in the title or description'),
(5, 'mysql article', 'mydomain.com/mysql', 'mysql is definitely written in every field');
これは私が使用しているクエリです:
select * from `testtable` where MATCH(title, link, description) AGAINST('mysql')
mysql という語句は、行 4 を除くすべての少なくとも 1 つの列に表示されますが、行 5 にはすべての列に語句 mysql があります。したがって、少なくとも行 5 を返す必要があります。しかし、結果は返されません。
なぜこれが起こっているのか、誰でも説明できますか?