Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| layout: post.ja | ||
| title: Mroonga 7.06リリース! | ||
| description: Mroonga 7.06をリリースしました! | ||
| --- | ||
|
|
||
| ## Mroonga 7.06リリース! | ||
|
|
||
| 今日は肉の日ですね! | ||
|
|
||
| [Mroonga 7.06](/ja/docs/news.html#release-7-06) をリリースしました! | ||
|
|
||
| * インストール方法: [インストール](/ja/docs/install.html) | ||
| * アップグレード方法: [アップグレードガイド](/ja/docs/upgrade.html) | ||
|
|
||
| ### 変更点 | ||
|
|
||
| 今月の変更点は以下の通りです。 | ||
|
|
||
| * 生成カラム(Generated Column)のサポート | ||
|
|
||
| ### 生成カラム(Generated Column)のサポート | ||
|
|
||
| 今回のリリースでは、生成カラム(Generated Column)をMroongaでもサポートしました。 | ||
| これは他のカラムの値を自動計算した結果を取り出すことのできるカラムを定義できる機能です。 | ||
|
|
||
| たとえば、次のような定義でJSONの一部を取り出した結果を使って検索することができるようになります。 | ||
|
|
||
| CREATE TABLE logs ( | ||
| id INT, | ||
| record JSON, | ||
| message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED, | ||
| FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"' | ||
| ) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; | ||
|
|
||
| 上記の例だと、`record` の値の一部を `message` カラムの内容として定義しています。 | ||
| すると、次のようなクエリでJSONの一部だけを全文検索することができます。 | ||
|
|
||
| > SELECT * FROM logs WHERE MATCH(message) AGAINST("ar" IN BOOLEAN MODE); | ||
| +------+-----------------------------------------+-----------+ | ||
| | id | record | message | | ||
| +------+-----------------------------------------+-----------+ | ||
| | 1 | {"level": "info", "message": "start"} | "start" | | ||
| | 2 | {"level": "info", "message": "restart"} | "restart" | | ||
| +------+-----------------------------------------+-----------+ | ||
| 2 rows in set (0.02 sec) | ||
|
|
||
| 実データを持たない `VIRTUAL` も定義できます。 | ||
|
|
||
| CREATE TABLE logs ( | ||
| id INT, | ||
| record JSON, | ||
| message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL | ||
| ) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4; | ||
|
|
||
| ただし、この場合、`FULLTEXT INDEX(message)` を張ることはできません。 | ||
|
|
||
| ### おわりに | ||
|
|
||
| 7.05からの詳細な変更点は[7.06リリース - 2017-08-29](/ja/docs/news.html#release-7-06)を確認してください。 | ||
|
|
||
| それでは、Mroongaでガンガン検索してください! |