[Groonga-commit] groonga/groonga.org at 21af956 [gh-pages] blog ja: add more topics

Back to archive index

HAYASHI Kentaro null+****@clear*****
Wed Apr 27 16:29:57 JST 2016


HAYASHI Kentaro	2016-04-27 16:29:57 +0900 (Wed, 27 Apr 2016)

  New Revision: 21af956ca485c717db7791154831b618b2ca0d59
  https://github.com/groonga/groonga.org/commit/21af956ca485c717db7791154831b618b2ca0d59

  Message:
    blog ja: add more topics

  Modified files:
    ja/_posts/2016-04-29-groonga-6.0.2.md

  Modified: ja/_posts/2016-04-29-groonga-6.0.2.md (+119 -2)
===================================================================
--- ja/_posts/2016-04-29-groonga-6.0.2.md    2016-04-27 12:59:46 +0900 (00eeb23)
+++ ja/_posts/2016-04-29-groonga-6.0.2.md    2016-04-27 16:29:57 +0900 (636a697)
@@ -37,11 +37,128 @@ published: false
 
 #### リクエストにタイムアウトを指定できるようになりました
 
-TODO:
+今回のリリースでは、各リクエストにタイムアウトを設定できるようになりました。
+
+指定したタイムアウトまでにリクエストが完了しなかった場合、そのリクエストはキャンセルされます。タイムアウトを設定しない場合、そのリクエストが完了するまで処理をします。
+
+リクエストにタイムアウトを設定するには、``--request_timeout``パラメータを指定します。次の例では、タイムアウトを5秒に指定しています。
+
+    select Users --request_timeout 5
+
+
+詳細については、[リクエストタイムアウト](ja/html/reference/command/request_timeout.html)のドキュメントを参照してください。
 
 #### ドリルダウンで多段の集計やグループをサポートしました
 
-TODO:
+今回のリリースでは、[高度なドリルダウン](/ja/docs/reference/commands/select.html#select-advanced-drilldown-related-parameters)がさらに進化し、多段でドリルダウンできるようになりました。
+
+どんなふうに使えるのか、簡単な例を紹介します。
+例えば、カテゴリ、タグの順に多段でドリルダウンしてみましょう。
+
+``Memo``というテーブルに``tag``というカラムがあり、``Tags``テーブルに``category``というカラムが用意されているスキーマを使います。
+
+    table_create Tags TABLE_PAT_KEY ShortText
+    column_create Tags category COLUMN_SCALAR ShortText
+
+    table_create Memos TABLE_HASH_KEY ShortText
+    column_create Memos tag COLUMN_SCALAR Tags
+
+次に、それぞれのテーブルにサンプルデータを登録します。
+
+    load --table Memos
+    [
+    {"_key": "Groonga is fast!", "tag": "Groonga"},
+    {"_key": "Mroonga is fast!", "tag": "Mroonga"},
+    {"_key": "Groonga sticker!", "tag": "Groonga"},
+    {"_key": "Rroonga is fast!", "tag": "Rroonga"}
+    ]
+    
+    load --table Tags
+    [
+    {"_key": "Groonga", "category": "C/C++"},
+    {"_key": "Mroonga", "category": "C/C++"},
+    {"_key": "Rroonga", "category": "Ruby"}
+    ]
+
+これで準備ができました。
+
+実際に多段でドリルダウンしてみましょう。
+次のようなクエリを実行します。ポイントはラベルでドリルダウンの関連づけをしているところです。
+
+    select Memos \
+      --drilldown[label1].table label2 \
+      --drilldown[label1].keys category \
+      --drilldown[label1].output_columns _key,_nsubrecs \
+      --drilldown[label2].keys tag \
+      --drilldown[label2].output_columns _key,_nsubrecs,category
+
+高度なドリルダウンでは、ラベルを使って複数のドリルダウンを実行することができました。
+ただし、それぞれのドリルダウンは独立していて、多段にすることはできなかったのがこれまでとの違いです。
+
+実行すると次のような結果が得られます。
+
+    {
+      "label1": [
+        [
+          2
+        ],
+        [
+          [
+            "_key",
+            "ShortText"
+          ],
+          [
+            "_nsubrecs",
+            "Int32"
+          ]
+        ],
+        [
+          "C/C++",
+          2
+        ],
+        [
+          "Ruby",
+          1
+        ]
+      ],
+      "label2": [
+        [
+          3
+        ],
+        [
+          [
+            "_key",
+            "ShortText"
+          ],
+          [
+            "_nsubrecs",
+            "Int32"
+          ],
+          [
+            "category",
+            "ShortText"
+          ]
+        ],
+        [
+          "Groonga",
+          2,
+          "C/C++"
+        ],
+        [
+          "Mroonga",
+          1,
+          "C/C++"
+        ],
+        [
+          "Rroonga",
+          1,
+          "Ruby"
+        ]
+      ]
+    }
+
+``label1``はカテゴリでドリルダウンしていました。そのため、``C/C++``が2件、``Ruby``が1件というようにグループ化されています。
+``label2``はさらにタグでドリルダウンすることで、``C/C++``というカテゴリに``Groonga``は2件あることがわかります。
 
 #### Debian GNU/Linux 7.0 (Wheezy)のサポート終了
 
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index