Kouhei Sutou
null+****@clear*****
Thu Jan 29 22:23:18 JST 2015
Kouhei Sutou 2015-01-29 22:23:18 +0900 (Thu, 29 Jan 2015) New Revision: c68fa1bddbdd616644878b4bf10d3f5f7aca0c25 https://github.com/groonga/groonga.org/commit/c68fa1bddbdd616644878b4bf10d3f5f7aca0c25 Message: Remove trailing spaces Modified files: en/_posts/2015-01-29-release.md ja/_posts/2015-01-29-release.md Modified: en/_posts/2015-01-29-release.md (+5 -5) =================================================================== --- en/_posts/2015-01-29-release.md 2015-01-29 15:59:08 +0900 (90008fd) +++ en/_posts/2015-01-29-release.md 2015-01-29 22:23:18 +0900 (4e198d6) @@ -35,11 +35,11 @@ Try to pass following parameter to select command: Here is the simple example which use MAX. table_create Tags TABLE_PAT_KEY ShortText - + table_create Memos TABLE_HASH_KEY ShortText column_create Memos tag COLUMN_SCALAR Tags column_create Memos priority COLUMN_SCALAR Int64 - + load --table Memos [ {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, @@ -52,14 +52,14 @@ Here is the simple example which use MAX. {"_key": "Rroonga2", "tag": "Rroonga", "priority": -25}, {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} ] - + select Memos \ --limit 0 \ --drilldown[tag].keys tag \ --drilldown[tag].calc_types MAX \ --drilldown[tag].calc_target priority \ --drilldown[tag].output_columns _key,_max - + Here is the drilldown results. { @@ -97,7 +97,7 @@ The data is grouped by tag, there are three groups - "Groonga", "Mroonga" and "R If you want to get not only max value, but also min value, specify multiple types for calc_types. Here is the example which gets max value and min value: - --drilldown[tag].calc_types MAX,MIN + --drilldown[tag].calc_types MAX,MIN Don't forget to specify pseudo column name "_min". Modified: ja/_posts/2015-01-29-release.md (+5 -5) =================================================================== --- ja/_posts/2015-01-29-release.md 2015-01-29 15:59:08 +0900 (08e994f) +++ ja/_posts/2015-01-29-release.md 2015-01-29 22:23:18 +0900 (4d25142) @@ -44,11 +44,11 @@ drilldownした結果をグループごとにSUM (合計)、 MIN (最小値)、 具体的な例をみてみましょう。MAXを使ってグループごとの最大値を取得する例です。 table_create Tags TABLE_PAT_KEY ShortText - + table_create Memos TABLE_HASH_KEY ShortText column_create Memos tag COLUMN_SCALAR Tags column_create Memos priority COLUMN_SCALAR Int64 - + load --table Memos [ {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, @@ -61,14 +61,14 @@ drilldownした結果をグループごとにSUM (合計)、 MIN (最小値)、 {"_key": "Rroonga2", "tag": "Rroonga", "priority": -25}, {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} ] - + select Memos \ --limit 0 \ --drilldown[tag].keys tag \ --drilldown[tag].calc_types MAX \ --drilldown[tag].calc_target priority \ --drilldown[tag].output_columns _key,_max - + 結果は次のようになります。 { @@ -104,7 +104,7 @@ drilldownした結果をグループごとにSUM (合計)、 MIN (最小値)、 3つにグループ化され、タグとグループごとの最大値が返ってくるのがわかります。 最大値だけでなく最小値も取得したいなら、`calc_types`に複数カンマ区切りで指定します。 - --drilldown[tag].calc_types MAX,MIN + --drilldown[tag].calc_types MAX,MIN `output_columns` に `_min` 疑似カラムの指定も忘れないようにしましょう。 -------------- next part -------------- HTML����������������������������...Télécharger