DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
FULLTEXT INDEX title_index (title)
) DEFAULT CHARSET UTF8MB4 COMMENT = 'ENGINE "InnoDB"';
INSERT INTO diaries (title) VALUES ("survey");
SELECT * FROM diaries;
id	title
1	survey
ALTER TABLE diaries ADD COLUMN body TEXT;
UPDATE diaries SET body = "will start groonga!";
SELECT * FROM diaries;
id	title	body
1	survey	will start groonga!
INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga...");
INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga.");
SELECT * FROM diaries;
id	title	body
1	survey	will start groonga!
2	groonga (1)	starting groonga...
3	groonga (2)	started groonga.
ALTER TABLE diaries ADD FULLTEXT INDEX body_index (body);
SELECT * FROM diaries
WHERE MATCH(title) AGAINST("survey") AND
MATCH(body) AGAINST("groonga");
id	title	body
1	survey	will start groonga!
SELECT * FROM diaries
WHERE MATCH(title) AGAINST("groonga") AND
MATCH(body) AGAINST("starting");
id	title	body
2	groonga (1)	starting groonga...
DROP TABLE diaries;
