Skip to content

Instantly share code, notes, and snippets.

@naoa
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naoa/caca0f0eededf5e881b8 to your computer and use it in GitHub Desktop.
Save naoa/caca0f0eededf5e881b8 to your computer and use it in GitHub Desktop.
mysql> drop table terms;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table memos;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE terms (
-> term VARCHAR(255) NOT NULL PRIMARY KEY
-> ) Engine=Mroonga COMMENT='default_tokenizer "TokenBigram"' DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.09 sec)
mysql> CREATE TABLE memos (
-> id INT NOT NULL PRIMARY KEY,
-> memo TEXT NOT NULL,
-> FULLTEXT INDEX (memo) COMMENT 'table "terms"'
-> ) Engine=Mroonga DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.14 sec)
mysql> INSERT INTO memos VALUES (1, "今日は雨だなぁ。");
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM terms;
+------+
| term |
+------+
| |
| |
| |
| |
| |
| |
| |
| |
+------+
8 rows in set (0.00 sec)
mysql> SELECT mroonga_command('select terms');
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mroonga_command('select terms') |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| [[[8],[["_id","UInt32"],["_key","ShortText"],["memo","memos"],["term","ShortText"]],[8,"。",1,""],[7,"ぁ",1,""],[5,"だな",1,""],[6,"なぁ",1,""],[3,"は雨",1,""],[1,"今日",1,""],[2,"日は",1,""],[4,"雨だ",1,""]]] |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT term FROM terms;
+------+
| term |
+------+
| |
| |
| |
| |
| |
| |
| |
| |
+------+
8 rows in set (0.00 sec)
mysql> SELECT _key FROM terms;
ERROR 1054 (42S22): Unknown column '_key' in 'field list'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment