DROP TABLE IF EXISTS memos;
SET NAMES utf8mb4;
CREATE TABLE memos (
id INT PRIMARY KEY,
title VARCHAR(255),
content TEXT,
FULLTEXT INDEX (title, content)
) DEFAULT CHARSET=utf8mb4;
INSERT INTO memos VALUES(1, "Groonga", "Groonga is fast.");
INSERT INTO memos VALUES(2, "Mroonga", "Mroonga is also fast.");
INSERT INTO memos VALUES(3, "Rroonga", "Rroonga is also fast.");
SELECT *,
MATCH(title, content)
AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE) AS score
FROM memos
WHERE MATCH(title, content)
AGAINST("*W1:10,2:2DOR Groonga Mroonga" in BOOLEAN MODE);
id	title	content	score
1	Groonga	Groonga is fast.	12
2	Mroonga	Mroonga is also fast.	12
DROP TABLE memos;
