DROP TABLE IF EXISTS memos;
SET NAMES UTF8MB4;
CREATE TABLE memos (
id INT UNSIGNED,
content TEXT,
FULLTEXT INDEX(content)
) DEFAULT CHARSET UTF8MB4;
INSERT INTO memos VALUES(1, 'Groonga is fast.');
INSERT INTO memos VALUES(2, 'Mroonga is based on Groonga.');
INSERT INTO memos VALUES(3, 'Groonga is embeddable full text search engine.');
INSERT INTO memos VALUES(4, 'Mroonga is fast too.');
SELECT *, RAND(2) AS random_score
FROM memos
WHERE MATCH(content) AGAINST('*D+ Groonga OR Mroonga' IN BOOLEAN MODE)
ORDER BY random_score
LIMIT 3;
id	content	random_score
2	Mroonga is based on Groonga.	0.12234661925802624
3	Groonga is embeddable full text search engine.	0.64497318737672
1	Groonga is fast.	0.6555866465490187
SHOW STATUS LIKE 'mroonga_fast_order_limit';
Variable_name	Value
Mroonga_fast_order_limit	0
DROP TABLE memos;
