我没有收到以下返回的任何行,我不知道为什么。我是否正确定义了全文索引?
CREATE TABLE `client_contact` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`company` int(11) DEFAULT NULL,
`billing_address` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
FULLTEXT KEY `client_search` (`first_name`,`last_name`,`email`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `client_contact` (`first_name`, `last_name`, `email`, `phone`, `company`, `billing_address`) VALUES
('John', 'Smith', 'john.smith@company.com', '123456', 1, '1 Any Street'),
('Mary', 'Smith', 'mary.smith@company.com', '123456', 1, '1 Any Street');
SELECT cl.*
FROM client_contact cl
WHERE MATCH(cl.first_name, cl.last_name, cl.email) AGAINST ('Smith')