DROP DATABASE IF EXISTS mroonga;
CREATE DATABASE mroonga;
USE mroonga;
CREATE TABLE tags (
name VARCHAR(64) PRIMARY KEY
) DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_bin
COMMENT='default_tokenizer "TokenDelimit"';
CREATE TABLE bugs (
id INT UNSIGNED PRIMARY KEY,
tags TEXT COMMENT 'flags "COLUMN_VECTOR", type "tags"',
FULLTEXT INDEX bugs_tags_index (tags) COMMENT 'table "tags"'
) DEFAULT CHARSET=utf8mb4;
INSERT INTO bugs (id, tags) VALUES (1, "Linux MySQL groonga");
SELECT mroonga_command("dump --dump_plugins no --dump_records no");
mroonga_command("dump --dump_plugins no --dump_records no")
table_create bugs TABLE_PAT_KEY UInt32
column_create bugs id COLUMN_SCALAR UInt32

table_create mroonga_operations TABLE_NO_KEY
column_create mroonga_operations record COLUMN_SCALAR UInt32
column_create mroonga_operations table COLUMN_SCALAR ShortText
column_create mroonga_operations type COLUMN_SCALAR ShortText

table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit
column_create tags name COLUMN_SCALAR ShortText

column_create bugs tags COLUMN_VECTOR tags

column_create tags bugs_tags_index COLUMN_INDEX|WITH_POSITION bugs tags
SELECT *, MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE) AS score
FROM bugs
WHERE MATCH (tags) AGAINST ("+MySQL" IN BOOLEAN MODE);
id	tags	score
1	Linux MySQL groonga	1
DROP TABLE bugs;
DROP TABLE tags;
DROP DATABASE mroonga;
