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
28
29
30
31
32
33
34
35
36
37
38
39
40
|
DROP TABLE IF EXISTS memos;
SET NAMES utf8;
CREATE TABLE memos (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(64),
content TEXT,
FULLTEXT INDEX(content)
) DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"';
SHOW CREATE TABLE memos;
Table Create Table
memos CREATE TABLE `memos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(64) DEFAULT NULL,
`content` text,
PRIMARY KEY (`id`),
FULLTEXT KEY `content` (`content`)
) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='engine "InnoDB"'
INSERT INTO memos (title, content) VALUES ("Hello", "I start to write memos!");
INSERT INTO memos (title, content) VALUES ("groonga", "I start to use groonga!");
INSERT INTO memos (title, content) VALUES ("mroonga", "I use mroonga too!");
ALTER TABLE memos COMMENT='engine "MyISAM"';
SHOW CREATE TABLE memos;
Table Create Table
memos CREATE TABLE `memos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(64) DEFAULT NULL,
`content` text,
PRIMARY KEY (`id`),
FULLTEXT KEY `content` (`content`)
) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='engine "MyISAM"'
SELECT * FROM memos;
id title content
1 Hello I start to write memos!
2 groonga I start to use groonga!
3 mroonga I use mroonga too!
SELECT * FROM memos WHERE MATCH(content) AGAINST("start" IN BOOLEAN MODE);
id title content
1 Hello I start to write memos!
2 groonga I start to use groonga!
DROP TABLE memos;
|