DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
body TEXT,
FULLTEXT INDEX title_index (title),
FULLTEXT INDEX body_index (body)
) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET=UTF8MB4;
START TRANSACTION;
INSERT INTO diaries (title, body) VALUES ("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
WHERE MATCH(body) AGAINST("groonga")
ORDER BY id;
id	title	body
1	survey	will start groonga!
2	groonga (1)	starting groonga...
3	groonga (2)	started groonga.
USE test;
SELECT * FROM diaries
WHERE MATCH(body) AGAINST("groonga")
ORDER BY id;
id	title	body
COMMIT;
SELECT * FROM diaries
WHERE MATCH(body) AGAINST("groonga")
ORDER BY id;
id	title	body
1	survey	will start groonga!
2	groonga (1)	starting groonga...
3	groonga (2)	started groonga.
SELECT * FROM diaries
WHERE MATCH(body) AGAINST("groonga")
ORDER BY id;
id	title	body
1	survey	will start groonga!
2	groonga (1)	starting groonga...
3	groonga (2)	started groonga.
DROP TABLE diaries;
