我在尝试对 mysql 中的表执行全文搜索时遇到问题。有问题的表具有以下创建命令:
CREATE TABLE IF NOT EXISTS `resume_contents`
(`resumeid` int(100) NOT NULL AUTO_INCREMENT,
`jobseekerid` varchar(255) NOT NULL,
`resumecontents` text,
PRIMARY KEY (`resumeid`),
UNIQUE KEY `jobseekerid` (`jobseekerid`),
FULLTEXT KEY `resumecontents` (`resumecontents`) )
ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
所以基本上只有 3 列,一列只有全文。然后,当我尝试使用以下命令进行全文搜索时:
SELECT * FROM `resume_contents` WHERE MATCH (resumecontents) AGAINST('')
无论反对子句中有什么词,我每次都会得到一个空的结果集。我在这里犯了什么愚蠢的错误?
例如,这里是我正在测试的一行,它有一个来自 resume.com 的简历样本。
INSERT INTO `resume_contents` (`resumeid`, `jobseekerid`, `resumecontents`) VALUES (2, '14', 'Objectives\nI am looking for a position at This Company where I can maximize my programming skills, project management, leadership skills, and create new and exciting tools.\n\n\nSummary\nI have had 3 years experience in web design and development. I am fimilar with a lot of the languages and software used in creating projects for the web. Futhermore, I have great project management skills and also work well either alone or with a group. I have also worked on small projects and large public releases for large companies.\n\n\nEducation\nDesign Media \nCollege Humor, Seattle, WA\nGraduated: January 2008 \nGrade: College\n\nEmployment History\nDecember 2007 – Present: Web Designer \nCompany: ComStream\nSeattle, Washington\nWorked as team lead on many different client projects.\n\n\nProfessional Skills\nAdobe Photoshop – Expert\n\nAdobe Illustrator – Expert\n\nAdobe Dreamweaver – Advanced\n\nPhp – Advanced\n\n\nQualification/Certification\nJanuary 2006: New Media Design \nOrganization: School of Technology\nAward: \nSan Fransico\nLanguages\nCzech – Beginner\n\nVietnamese – Conversational\n\n\nImmigration / Work Status\nDecember 2041 – Permanent Resident - United States');
然后我搜索:
SELECT * FROM `resume_contents` WHERE MATCH(`resumecontents`) AGAINST ('Company')
或者我知道的任何单词或短语(任何长度,任何单词)都在那里......但它仍然返回一个空集。我知道它一定是我想念的简单的东西,但我不知道它可能是什么。