CREATE TABLE books2 ENGINE MyISAM SELECT FROM bookshop books CREATE FU

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
CREATE TABLE books2 ENGINE=MyISAM SELECT * FROM bookshop.books;
CREATE FULLTEXT INDEX ixFullText ON books2 (title, author);
mysql> SELECT * FROM books2 WHERE MATCH (title, author) AGAINST ('mysql Зандстра');
mysql> SELECT title, author FROM books2 WHERE MATCH (title, author) AGAINST ('mysql Зандстра' IN NATURAL LANGUAGE MODE);
mysql> SELECT title, author FROM books2 WHERE MATCH (title, author) AGAINST ('основы программирования' IN NATURAL LANGUAGE MODE);
mysql> SELECT title, author FROM books2 WHERE MATCH (title, author) AGAINST ('+mysql -Дюбуа' IN BOOLEAN MODE);
mysql> SELECT title, author FROM books2 WHERE MATCH (title, author) AGAINST ('-Макфарланд +Java*' IN BOOLEAN MODE);
mysql> SELECT SUBSTRING(title,1,30), publisher, MATCH (title, author) AGAINST ('android' IN NATURAL LANGUAGE MODE) AS score
-> FROM books2 WHERE MATCH (title, author) AGAINST ('android' IN BOOLEAN MODE) ORDER BY score DESC;
mysql> SELECT title, publisher, MATCH (title, author) AGAINST ('php' IN NATURAL LANGUAGE MODE) AS score
-> FROM books2 WHERE MATCH (title, author) AGAINST ('php' IN BOOLEAN MODE) ORDER BY score DESC;
Empty set (0.00 sec)