1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| create table myDoc( id int auto_increment primary key, title varchar(100), content text, fulltext(title,content) ) insert into myDoc(title,content) values ('MySQL Tutorial','DBMSstands for DataBase...'), ('How To Use MySQL Well','Afteryou went through a ...'), ('Optimizing MySQL','Inthis tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqldas root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','Whenconfigured properly, MySQL ...');
select * from myDoc where match(title,content) against('database' in natural language mode)
select id,match(title,content) against('database') as score from myDoc
match(title,content) against('+MySQL -YourSQL'in boolean mode) match(title,content) against('+MySQL +YourSQL'in boolean mode) match(title,content) against('+MySQL YourSQL'in boolean mode)
|