Kouhei Sutou
null+****@clear*****
Tue Nov 7 16:48:30 JST 2017
Kouhei Sutou 2017-11-07 16:48:30 +0900 (Tue, 07 Nov 2017) New Revision: 08cd54034ac7496b57acbca7b4783bafaa812a76 https://github.com/groonga/groonga/commit/08cd54034ac7496b57acbca7b4783bafaa812a76 Message: doc logical_count: add more descriptions Added files: doc/source/example/reference/commands/logical_count/cache_no.log doc/source/example/reference/commands/logical_count/columns_name_flags.log doc/source/example/reference/commands/logical_count/columns_name_stage.log doc/source/example/reference/commands/logical_count/columns_name_type.log doc/source/example/reference/commands/logical_count/columns_name_value.log doc/source/example/reference/commands/logical_count/columns_name_window_group_keys.log doc/source/example/reference/commands/logical_count/columns_name_window_sort_keys.log doc/source/example/reference/commands/logical_count/filter.log doc/source/example/reference/commands/logical_count/logical_table_existent.log doc/source/example/reference/commands/logical_count/logical_table_nonexistent.log doc/source/example/reference/commands/logical_count/max.log doc/source/example/reference/commands/logical_count/max_border.log doc/source/example/reference/commands/logical_count/min.log doc/source/example/reference/commands/logical_count/min_border.log doc/source/example/reference/commands/logical_count/usage.log doc/source/example/reference/commands/logical_count/usage_plugin_register.log Modified files: doc/locale/ja/LC_MESSAGES/reference.po doc/source/reference/commands/logical_count.rst doc/source/reference/commands/logical_range_filter.rst doc/source/reference/commands/logical_select.rst Modified: doc/locale/ja/LC_MESSAGES/reference.po (+494 -484) =================================================================== --- doc/locale/ja/LC_MESSAGES/reference.po 2017-11-07 16:15:51 +0900 (6a12552e6) +++ doc/locale/ja/LC_MESSAGES/reference.po 2017-11-07 16:48:30 +0900 (b0d42a314) @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.2.1\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2017-11-07 10:33+0900\n" +"PO-Revision-Date: 2017-11-07 16:48+0900\n" "Last-Translator: Masafumi Yokoyama <yokoyama �� clear-code.com>\n" "Language-Team: Japanese\n" "Language: ja\n" @@ -7018,36 +7018,58 @@ msgid "``logical_count``" msgstr "" msgid "" -"``logical_count`` is a command to count matched records even though actual " -"records are stored into parted tables. It is useful for users because there " -"is less need to care about maximum records of table :doc:`/limitations`." +"``logical_count`` is a command that has only count feature in :doc:" +"`logical_select`. :doc:`logical_select` searches records from multiple " +"tables, outputs the number of matched records, outputs columns of the " +"matched records and so on. ``logical_count`` only searches records from " +"multiple tables and output the number of matched records." msgstr "" -"``logical_count`` は別のテーブルに保存されているレコードであっても、マッチす" -"るレコードをカウントするためのコマンドです。テーブルの最大レコード数の :doc:" -"`/limitations` を気にしなくてすむようになります。" +"``logical_count`` は :doc:`logical_select` の件数カウント機能だけを提供するコ" +"マンドです。 :doc:`logical_select` は複数のテーブルからレコードを検索し、マッ" +"チしたレコード数を出力し、マッチしたレコードのカラムを出力し、他にもいろいろ" +"します。 ``logical_count`` は複数のテーブルからレコードを検索し、マッチしたレ" +"コード数を出力するだけです。" msgid "" -"Note that this feature is not matured yet, so there are some limitations." -msgstr "この機能はまだこなれていないので、いくつか制限があります。" +"``logical_count`` is useful when you just want the number of matched " +"records. You can use ``logical_count`` and :doc:`logical_range_filter` at " +"once. You can show the first N matched records before you get the number of " +"matched records. If you use only :doc:`logical_select`, you need to wait " +"finishing all search." +msgstr "" +"``logical_count`` はマッチしたレコードの数だけを知りたいときに便利です。 " +"``logical_count`` と :doc:`logical_range_filter` を一緒に使えます。一緒に使う" +"と、マッチしたレコード数を取得する前に、マッチしたレコードのうち先頭のNレコー" +"ドだけを先に表示できます。 :doc:`logical_select` だけを使っている場合は、すべ" +"ての検索処理が終わるまで待たなければいけません。" msgid "" -"Create parted tables which contains \"_YYYYMMDD\" postfix. It is hardcoded, " -"so you must create tables by each day." +"You need to :doc:`plugin_register` ``sharding`` plugin because this command " +"is included in ``sharding`` plugin." msgstr "" -"名前の末尾は「_YYYYMMDD」をつけてテーブルを作成します。これは決め打ちになって" -"いて、日ごとにテーブルを作成しないといけない" +"このコマンド は ``sharding`` プラグインに含まれているので、 ``sharding`` プラ" +"グインを :doc:`plugin_register` する必要があります。" -msgid "Load proper data into parted tables on your own." -msgstr "自分で個々のテーブルへ適切なデータをロードしないといけない" +msgid "" +"The required parameters are ``logical_table`` and ``shard_key``. Other " +"parameters are optional::" +msgstr "" +"必須の引数は ``logical_table`` と ``shard_key`` です。それ以外の引数は省略可" +"能です::" -msgid "The required parameters are ``logical_table`` and ``shard_key``::" -msgstr "必須引数は2つあります。 ``logical_table`` と ``shard_key`` です。" +msgid "" +"Let's learn about usage with examples. This section shows many popular " +"usages." +msgstr "" +"例を使いながら使い方を学びましょう。このセクションではよく使われる使い方を紹" +"介します。" msgid "" -"Register ``sharding`` plugin to use ``logical_count`` command in advance." +"You need to register ``sharding`` plugin because this command is included in " +"``sharding`` plugin." msgstr "" -"``logical_count`` コマンドを使うには事前に ``sharding`` プラグインを登録しま" -"す。" +"このコマンドは ``sharding`` プラグインに含まれているので ``sharding`` プラグ" +"インを登録する必要があります。" msgid "" "Note that ``logical_count`` is implemented as an experimental plugin, and " @@ -7063,55 +7085,69 @@ msgstr "" "この機能を使う簡単な例を示します。複数のテーブルに保存されている特定のログを" "カウントしてみましょう。" -msgid "Here is the schema and data." -msgstr "スキーマ定義とサンプルデータは以下の通りです。" - msgid "" -"There are three tables which are mapped each day from 2015 Feb 03 to 2015 " -"Feb 05." -msgstr "2015年の2月3日から5日までに対応したテーブルが3つあります。" - -msgid "Logs_20150203" +"There are two tables, ``Entries_20150708`` and ``Entries_20150709``, for " +"blog entries." msgstr "" +"ブログエントリー用に ``Entries_20150708`` と ``Entries_20150709`` の2つのテー" +"ブルがあります。" -msgid "Logs_20150204" +msgid "" +"You need to use ``${LOGICAL_TABLE_NAME}_${YYYYMMDD}`` naming rule for table " +"names. In this example, ``LOGICAL_TABLE_NAME`` is ``Entries`` and " +"``YYYYMMDD`` is ``20150708`` or ``20150709``." msgstr "" +"テーブル名には ``${論理テーブル名}_${YYYYMMDD}`` という命名規則を使う必要があ" +"ります。この例では、 ``論理テーブル名`` は ``Entries`` で ``YYYYMMDD`` は " +"``20150708`` または ``20150709`` です。" -msgid "Logs_20150205" +msgid "" +"An entry has title, created time, content, the number of likes for the entry " +"and tag. Title is key of ``Entries_YYYYMMDD``. Created time is value of " +"``Entries_YYYYMMDD.created_at`` column. Content is value of " +"``Entries_YYYYMMDD.content`` column. The number of likes is value of " +"``Entries_YYYYMMDD.n_likes`` column. Tag is value of ``Entries_YYYYMMDD." +"tag`` column." msgstr "" - -msgid "Then, it loads data into each table which correspond to." -msgstr "対応するテーブルへとデータを投入します。" +"各エントリはタイトルと作成日時と内容と「いいね!」数、タグを持っています。タ" +"イトルは ``Entries_YYYYMMDD`` のキーとします。作成日時は ``Entries_YYYYMMDD." +"created_at`` カラムの値とします。内容は ``Entries_YYYYMMDD.content`` カラムの" +"値とします。「いいね!」数は ``Entries_YYYYMMDD.n_likes`` カラムの値としま" +"す。タグは ``Entries_YYYYMMDD.tag`` カラムの値とします。" msgid "" -"Let's count logs which contains \"Shutdown\" in ``message`` column and the " -"value of timestamp is \"2015-02-04 00:00:00\" or later." +"``Entries_YYYYMMDD._key`` column and ``Entries_YYYYMMDD.content`` column are " +"indexed using ``TokenBigram`` tokenizer. So both ``Entries_YYYYMMDD._key`` " +"and ``Entries_YYYYMMDD.content`` are fulltext search ready." msgstr "" -"``message`` カラムに「Shutdown」が含まれていて、 ``timestamp`` カラムの値が" -"「2015-02-04 00:00:00」以降であるログをカウントしましょう。" +"``Entries_YYYYMMDD._key`` カラムと ``Entries_YYYYMMDD.content`` カラムには " +"``TokenBigram`` トークナイザーを使ったインデックスを作成します。そのため、 " +"``Entries_YYYYMMDD._key`` と ``Entries_YYYYMMDD.content`` は両方とも全文検索" +"できます。" -msgid "Here is the query to achieve above purpose." -msgstr "上記目的を達成するためのクエリがこちらです。" +msgid "OK. The schema and data for examples are ready." +msgstr "これで例を示すためのスキーマとデータの準備ができました。" msgid "" -"There is a well known limitation about the number of records. By sharding " -"feature, you can overcome such limitations because such a limitation is " -"applied per table." +"Here is an example to count the number of records which have ``Groonga`` or " +"``Senna`` in ``content`` column. ``logical_count`` searches records over all " +"``Entries_YYYYMMDD`` tables." msgstr "" -"レコード数には既知の制限があります。制限はテーブルごとなので、シャーディング" -"機能によってその制限を乗り越えることができます。" +"以下は ``content`` カラムに ``Groonga`` または ``Senna`` を含むレコード数を数" +"える例です。 ``logical_count`` はすべての ``Entries_YYYYMMDD`` テーブルを検索" +"します。" -msgid "" -"There is no convenient query such as ``PARTITIONING BY`` in SQL. Thus, you " -"must create table by ``table_create`` for each tables which contains " -"\"_YYYYMMDD\" postfix in table name." -msgstr "" -"SQLの ``PARTITIONING BY`` のような便利なクエリはありません。つまり、 " -"``table_create`` で「_YYYYMMDD」を名前の末尾に含むテーブルをそれぞれの作らな" -"ければなりません。" +msgid "Here are matched records:" +msgstr "マッチしたレコードは次の通りです。" + +msgid "``_key:\"Groonga\"`` in ``Entries_20150708``" +msgstr "``Entries_20150708`` の中の ``_key:\"Groonga\"``" -msgid "This section describes parameters of ``logical_count``." -msgstr "このセクションでは ``logical_count`` の引数について説明します。" +msgid "``_key:\"Good-bye Senna\"`` in ``Entries_20150709``" +msgstr "``Entries_20150709`` の中の ``_key:\"Good-bye Senna\"``" + +msgid "This section describes parameters of this command." +msgstr "このセクションではこのコマンドのパラメーターを説明します。" msgid "There are required parameters, ``logical_table`` and ``shard_key``." msgstr "必須引数は二つあります。 ``logical_table`` と ``shard_key`` です。" @@ -7128,41 +7164,342 @@ msgstr "" "す。実際のテーブルが ``Logs_20150203`` や ``Logs_20150203`` といったものな" "ら、論理テーブル名は ``Logs`` です。" +msgid "" +"You can count all records by specifying only ``logical_table`` and " +"``shard_key`` parameters. They are required parameters." +msgstr "" +"``logical_table`` と ``shard_key`` だけを指定すると全レコード数をカウントでき" +"ます。これらの引数は必須の引数です。" + +msgid "If nonexistent table is specified, an error is returned." +msgstr "存在しないテーブルを指定するとエラーが返ります。" + msgid "``shard_key``" msgstr "" msgid "" -"Specifies column name which is treated as shared key in each parted table." -msgstr "個々のテーブルで共通のキーとして扱うカラム名を指定します。" +"Specifies column name which is treated as shared key. Shard key is a column " +"that stores data that is used for distributing records to suitable shards." +msgstr "" +"シャードキーとして使うカラム名を指定します。シャードキーは適切なシャードへレ" +"コードを分配するために使う値を保存しているカラムです。" + +msgid "Shard key must be ``Time`` type for now." +msgstr "今のところ、シャードキーは ``Time`` 型でなければいけません。" + +msgid "See :ref:`logical-count-logical-table` how to specify ``shard_key``." +msgstr "" +"``shard_key`` の指定方法は :ref:`logical-count-logical-table` を見てくださ" +"い。" msgid "``min``" msgstr "" -msgid "Specifies the min value of ``shard_key``" -msgstr "``shard_key`` の最小値を指定します。" +msgid "" +"Specifies the minimum value of ``shard_key`` column. If shard doesn't have " +"any matched records, the shard isn't searched." +msgstr "" +"``shard_key`` カラムの最小値を指定します。シャードにマッチするレコードがない" +"場合は、そのシャードは検索対象外になります。" + +msgid "" +"For example, ``min`` is ``\"2015/07/09 00:00:00\"``, ``Entry_20150708`` " +"isn't searched. Because ``Entry_20150708`` has only records for ``" +"\"2015/07/08\"``." +msgstr "" +"たとえば、 ``min`` が ``\"2015/07/09 00:00:00\"`` なら、 ``Entry_20150708`` " +"は検索対象外です。なぜなら、 ``Entry_20150708`` は ``\"2015/07/08\"`` のレ" +"コードしかないからです。" + +msgid "" +"The following example only uses ``Entry_20150709`` table. ``Entry_20150708`` " +"isn't used." +msgstr "" +"以下の例は ``Entry_20150709`` テーブルだけを使う例です。 ``Entry_20150708`` " +"は使われません。" msgid "``min_border``" msgstr "" -msgid "" -"Specifies whether the min value of borderline must be include or not. " -"Specify ``include`` or ``exclude`` as the value of this parameter." -msgstr "" -"最小値を境界値として含めるのか否かを指定します。 ``include`` もしくは " -"``exclude`` を指定します。" +msgid "" +"Specifies whether the minimum value is included or not. Here is available " +"values." +msgstr "最小値を含めるかどうかを指定します。指定可能な値は次の通りです。" + +msgid "``include``" +msgstr "" + +msgid "Includes ``min`` value. This is the default." +msgstr "``min`` の値を含みます。これがデフォルト値です。" + +msgid "``exclude``" +msgstr "" + +msgid "Doesn't include ``min`` value." +msgstr "``min`` の値を含みません。" + +msgid "" +"Here is an example for ``exclude``. The result doesn't include the ``\"Good-" +"bye Senna\"`` record because its ``created_at`` value is ``\"2015/07/09 " +"00:00:00\"``." +msgstr "" +"次の例は ``exclude`` の使用例です。結果には ``\"Good-bye Senna\"`` レコードは" +"含まれません。このレコードの ``created_at`` の値が ``\"2015/07/09 " +"00:00:00\"`` だからです。" + +msgid "" +"Specifies the maximum value of ``shard_key`` column. If shard doesn't have " +"any matched records, the shard isn't searched." +msgstr "" +"``shard_key`` カラムの最大値を指定します。シャードにマッチするレコードがない" +"場合、そのシャードは検索対象外になります。" + +msgid "" +"For example, ``max`` is ``\"2015/07/08 23:59:59\"``, ``Entry_20150709`` " +"isn't searched. Because ``Entry_20150709`` has only records for ``" +"\"\"2015/07/09\"``." +msgstr "" +"たとえば、 ``max`` が ``\"2015/07/08 23:59:59\"`` なら ``Entry_20150709`` は" +"検索対象外です。なぜなら ``Entry_20150709`` には ``\"\"2015/07/09\"`` のレ" +"コードしかないからです。" + +msgid "" +"The following example only uses ``Entry_20150708`` table. ``Entry_20150709`` " +"isn't used." +msgstr "" +"以下の例は ``Entry_20150708`` テーブルだけを使います。 ``Entry_20150709`` は" +"使いません。" + +msgid "``max_border``" +msgstr "" + +msgid "" +"Specifies whether the maximum value is included or not. Here is available " +"values." +msgstr "最大値を含めるかどうかを指定します。指定可能な値は次の通りです。" + +msgid "Includes ``max`` value. This is the default." +msgstr "``max`` の値を含みます。これがデフォルト値です。" + +msgid "Doesn't include ``max`` value." +msgstr "``max`` の値を含みません。" + +msgid "Search related parameters" +msgstr "検索関係の引数" + +msgid "" +"This command provides :doc:`select` compatible search related parameters." +msgstr "" +"このコマンドは :doc:`select` 互換の検索関連パラメーターをサポートしています。" + +msgid "" +"Corresponds to :ref:`select-filter` in :doc:`select`. See :ref:`select-" +"filter` for details." +msgstr "" +":doc:`select` の :ref:`select-filter` に対応しています。詳細は :ref:`select-" +"filter` を見てください。" + +msgid "Dynamic column related parameters" +msgstr "動的カラム関連の引数" + +msgid "" +"All dynamic column related parameters in :doc:`select` are supported. See :" +"ref:`select-dynamic-column-related-parameters` for details." +msgstr "" +":doc:`select` のすべての動的カラム関連パラメーターをサポートしています。詳細" +"は :ref:`select-dynamic-column-related-parameters` を見てください。" + +msgid "``columns[${NAME}].stage``" +msgstr "" + +msgid "" +"Corresponds to :ref:`select-columns-name-stage` in :doc:`select`. See :ref:" +"`select-columns-name-stage` for details." +msgstr "" +":doc:`select` の :ref:`select-columns-name-stage` に対応しています。詳細は :" +"ref:`select-columns-name-stage` を見てください。" + +msgid "This is a required parameter." +msgstr "必須の引数です。" + +msgid "" +"Only ``initial`` stage is valid. Because there are no processes after " +"``filtered`` and ``output`` stages." +msgstr "" +"``initial`` ステージだけが有効です。なぜなら ``filtered`` ステージと " +"``output`` ステージ以降にはなにも処理がないからです。" + +msgid "" +"Here is an example that creates ``is_popular`` column at ``initial`` stage. " +"You can use ``is_popular`` in all parameters such as ``filter``:" +msgstr "" +"以下は ``initial`` ステージで ``is_popular`` カラムを作る例です。作成した " +"``is_popular`` カラムは ``filter`` を含むすべてのパラメーターで使えます。" + +msgid "``columns[${NAME}].flags``" +msgstr "" + +msgid "" +"Corresponds to :ref:`select-columns-name-flags` in :doc:`select`. See :ref:" +"`select-columns-name-flags` for details." +msgstr "" +":doc:`select` の :ref:`select-columns-name-flags` に対応しています。詳細は :" +"ref:`select-columns-name-flags` を見てください。" + +msgid "The default value is ``COLUMN_SCALAR``." +msgstr "デフォルト値は ``COLUMN_SCALAR`` です。" + +msgid "" +"Here is an example that creates a vector column by ``COLUMN_VECTOR`` flags. " +"``plugin_register functions/vector`` is for using :doc:`/reference/functions/" +"vector_new` function:" +msgstr "" +"以下は ``COLUMN_VECTOR`` フラグを指定してベクターカラムを作る例です。 " +"``plugin_register functions/vector`` は :doc:`/reference/functions/" +"vector_new` 関数を使うために実行しています。:" + +msgid "``columns[${NAME}].type``" +msgstr "" + +msgid "" +"Corresponds to :ref:`select-columns-name-type` in :doc:`select`. See :ref:" +"`select-columns-name-type` for details." +msgstr "" +":doc:`select` の :ref:`select-columns-name-type` に対応しています。詳細は :" +"ref:`select-columns-name-type` を見てください。" + +msgid "" +"Here is an example that creates a ``ShortText`` type column. Stored value is " +"casted to ``ShortText`` automatically. In this example, number is casted to " +"``ShortText``:" +msgstr "" +"以下は ``ShortText`` 型のカラムを作る例です。保存された値は自動的に " +"``ShortText`` にキャストされます。この例では数値が ``ShortText`` にキャストさ" +"れています。" + +msgid "``columns[${NAME}].value``" +msgstr "" + +msgid "" +"Corresponds to :ref:`select-columns-name-value` in :doc:`select`. See :ref:" +"`select-columns-name-value` for details." +msgstr "" +":doc:`select` の :ref:`select-columns-name-value` に対応しています。詳細は :" +"ref:`select-columns-name-value` を見てください。" + +msgid "" +"You need to specify :doc:`/reference/window_function` as ``value`` value and " +"other window function related parameters when you use window function. See :" +"ref:`logical-count-window-function-related-parameters` for details." +msgstr "" +"ウィンドウ関数を使う場合は、 ``value`` の値に :doc:`/reference/" +"window_function` を指定し、さらに他のウィンドウ関数関連のパラメーターも指定す" +"る必要があります。詳細は :ref:`logical-count-window-function-related-" +"parameters` を見てください。" + +msgid "" +"Here is an example that creates a new dynamic column that stores the number " +"of characters of content. This example uses :doc:`/reference/functions/" +"string_length` function in ``functions/string`` plugin to compute the number " +"of characters in a string. :doc:`plugin_register` is used to register " +"``functions/string`` plugin:" +msgstr "" +"以下は内容の文字数を格納するための動的カラムを1つ作る例です。この例では文字数" +"を数えるために ``functions/string`` プラグイン内の :doc:`/reference/" +"functions/string_length` 関数を使っています。 ``functions/string`` プラグイン" +"を登録するために :doc:`plugin_register` を使っています。" + +msgid "Window function related parameters" +msgstr "ウィンドウ関数関連の引数" + +msgid "" +"All window function related parameters in :doc:`select` are supported. See :" +"ref:`select-window-function-related-parameters` for details." +msgstr "" +":doc:`select` のすべてのウィンドウ関数関連パラメーターをサポートしています。" +"詳細は :ref:`select-window-function-related-parameters` を見てください。" + +msgid "Window function over multiple tables aren't supported yet." +msgstr "複数のテーブルをまたがったウィンドウ関数はまだサポートしていません。" + +msgid "``columns[${NAME}].window.sort_keys``" +msgstr "" + +msgid "" +"Corresponds to :ref:`select-columns-name-window-sort-keys` in :doc:`select`. " +"See :ref:`select-columns-name-window-sort-keys` for details." +msgstr "" +":doc:`select` の :ref:`select-columns-name-window-sort-keys` に対応していま" +"す。詳細は :ref:`select-columns-name-window-sort-keys` を見てください。" + +msgid "" +"You must specify :ref:`logical-count-columns-name-window-sort-keys` or :ref:" +"`logical-count-columns-name-window-group-keys` to use window function." +msgstr "" +"ウィンドウ関数を使うには :ref:`logical-count-columns-name-window-sort-keys` " +"または :ref:`logical-count-columns-name-window-group-keys` を指定しなければい" +"けません。" + +msgid "" +"Here is an example that computes cumulative sum per ``Entries.tag``. Each " +"group is sorted by ``Entries._key``:" +msgstr "" +"以下は ``Entries.tag`` 毎に累積和を計算する例です。各グループ内のレコードは " +"``Entries._key`` でソートします。" + +msgid "``columns[${NAME}].window.group_keys``" +msgstr "" + +msgid "" +"Corresponds to :ref:`select-columns-name-window-group-keys` in :doc:" +"`select`. See :ref:`select-columns-name-window-group-keys` for details." +msgstr "" +":doc:`select` の :ref:`select-columns-name-window-group-keys` に対応していま" +"す。詳細は :ref:`select-columns-name-window-group-keys` を見てください。" + +msgid "Here is an example that computes sum per ``Entries.tag``:" +msgstr "以下は ``Entries.tag`` 毎に合計を計算する例です。" + +msgid "Cache related parameter" +msgstr "キャッシュ関連の引数" + +msgid "``cache``" +msgstr "" + +msgid "Specifies whether caching the result of this query or not." +msgstr "このクエリーの結果をキャッシュするかどうかを指定します。" + +msgid "" +"If the result of this query is cached, the next same query returns response " +"quickly by using the cache." +msgstr "" +"このクエリーの結果がキャッシュしてあると、次に同じクエリーを実行するときは" +"キャッシュを使って高速にレスポンスを返すことができます。" + +msgid "It doesn't control whether existing cached result is used or not." +msgstr "" +"これは既存のキャッシュされた結果を使うかどうかを指定するものではありません。" + +msgid "``no``" +msgstr "" + +msgid "Don't cache the output of this query." +msgstr "このクエリーの出力をキャッシュしない。" + +msgid "``yes``" +msgstr "" + +msgid "Cache the output of this query. It's the default value." +msgstr "このクエリーの出力をキャッシュする。デフォルト値。" -msgid "Specifies the max value of ``shard_key``." -msgstr "``shard_key`` の最大値を指定します。" +msgid "Here is an example to disable caching the result of this query:" +msgstr "このクエリーの結果をキャッシュしないようにする例です。" -msgid "``max_border``" -msgstr "" +msgid "The command returns a response with the following format::" +msgstr "このコマンドは以下のフォーマットのレスポンスを返します::" -msgid "" -"Specifies whether the max value of borderline must be include or not. " -"Specify ``include`` or ``exclude`` as the value of this parameter." -msgstr "" -"最大値を境界値として含めるのか否かを指定します。 ``include`` もしくは " -"``exclude`` を指定します。" +msgid "``N_HITS`` is the number of matched records." +msgstr "``N_HITS`` はマッチしたレコード数です。" msgid "``logical_parameters``" msgstr "" @@ -7333,12 +7670,8 @@ msgstr "" "``logical_range_filter`` はマッチするレコードをすべて検索しないかもしれないか" "らです。" -msgid "" -"You need to :doc:`plugin_register` ``sharding`` plugin because this command " -"is included in ``sharding`` plugin." -msgstr "" -"このコマンド は ``sharding`` プラグインに含まれているので、 ``sharding`` プラ" -"グインを :doc:`plugin_register` する必要があります。" +msgid "The required parameters are ``logical_table`` and ``shard_key``::" +msgstr "必須引数は2つあります。 ``logical_table`` と ``shard_key`` です。" msgid "" "There are some parameters that can be only used as named parameters. You " @@ -7420,63 +7753,6 @@ msgstr "" msgid "``--columns[name2].value '_score * 0.1'``" msgstr "" -msgid "" -"Let's learn about usage with examples. This section shows many popular " -"usages." -msgstr "" -"例を使いながら使い方を学びましょう。このセクションではよく使われる使い方を紹" -"介します。" - -msgid "" -"You need to register ``sharding`` plugin because this command is included in " -"``sharding`` plugin." -msgstr "" -"このコマンドは ``sharding`` プラグインに含まれているので ``sharding`` プラグ" -"インを登録する必要があります。" - -msgid "" -"There are two tables, ``Entries_20150708`` and ``Entries_20150709``, for " -"blog entries." -msgstr "" -"ブログエントリー用に ``Entries_20150708`` と ``Entries_20150709`` の2つのテー" -"ブルがあります。" - -msgid "" -"You need to use ``${LOGICAL_TABLE_NAME}_${YYYYMMDD}`` naming rule for table " -"names. In this example, ``LOGICAL_TABLE_NAME`` is ``Entries`` and " -"``YYYYMMDD`` is ``20150708`` or ``20150709``." -msgstr "" -"テーブル名には ``${論理テーブル名}_${YYYYMMDD}`` という命名規則を使う必要があ" -"ります。この例では、 ``論理テーブル名`` は ``Entries`` で ``YYYYMMDD`` は " -"``20150708`` または ``20150709`` です。" - -msgid "" -"An entry has title, created time, content, the number of likes for the entry " -"and tag. Title is key of ``Entries_YYYYMMDD``. Created time is value of " -"``Entries_YYYYMMDD.created_at`` column. Content is value of " -"``Entries_YYYYMMDD.content`` column. The number of likes is value of " -"``Entries_YYYYMMDD.n_likes`` column. Tag is value of ``Entries_YYYYMMDD." -"tag`` column." -msgstr "" -"各エントリはタイトルと作成日時と内容と「いいね!」数、タグを持っています。タ" -"イトルは ``Entries_YYYYMMDD`` のキーとします。作成日時は ``Entries_YYYYMMDD." -"created_at`` カラムの値とします。内容は ``Entries_YYYYMMDD.content`` カラムの" -"値とします。「いいね!」数は ``Entries_YYYYMMDD.n_likes`` カラムの値としま" -"す。タグは ``Entries_YYYYMMDD.tag`` カラムの値とします。" - -msgid "" -"``Entries_YYYYMMDD._key`` column and ``Entries_YYYYMMDD.content`` column are " -"indexed using ``TokenBigram`` tokenizer. So both ``Entries_YYYYMMDD._key`` " -"and ``Entries_YYYYMMDD.content`` are fulltext search ready." -msgstr "" -"``Entries_YYYYMMDD._key`` カラムと ``Entries_YYYYMMDD.content`` カラムには " -"``TokenBigram`` トークナイザーを使ったインデックスを作成します。そのため、 " -"``Entries_YYYYMMDD._key`` と ``Entries_YYYYMMDD.content`` は両方とも全文検索" -"できます。" - -msgid "OK. The schema and data for examples are ready." -msgstr "これで例を示すためのスキーマとデータの準備ができました。" - msgid "Simple usage" msgstr "簡単な使い方" @@ -7486,264 +7762,121 @@ msgstr "このセクションでは ``logical_range_filter`` の引数につい msgid "TODO: Add examples" msgstr "" -msgid "``order``" -msgstr "" - -msgid "Output related parameters" -msgstr "出力関連の引数" - -msgid "" -"Corresponds to :ref:`select-output-columns` in :doc:`select`. See :ref:" -"`select-output-columns` for details." -msgstr "" -":doc:`select` の :ref:`select-output-columns` に対応しています。詳細は :ref:" -"`select-output-columns` を見てください。" - -msgid "" -"Corresponds to :ref:`select-offset` in :doc:`select`. See :ref:`select-" -"offset` for details." -msgstr "" -":doc:`select` の :ref:`select-offset` に対応しています。詳細は :ref:`select-" -"offset` を見てください。" - -msgid "" -"Corresponds to :ref:`select-limit` in :doc:`select`. See :ref:`select-limit` " -"for details." -msgstr "" -":doc:`select` の :ref:`select-limit` に対応しています。詳細は :ref:`select-" -"limit` を見てください。" - -msgid "" -"The difference from :doc:`select` is that this command stops searching when " -"all requested records specified by :ref:`logical-range-filter-offset` and :" -"ref:`logical-range-filter-limit` are found." -msgstr "" -":doc:`select` との違いは、このコマンドは :ref:`logical-range-filter-offset` " -"と :ref:`logical-range-filter-limit` で指定したレコードを見つけたら検索を終了" -"することです。" - -msgid "Test related parameters" -msgstr "テスト関連の引数" - -msgid "``use_range_index``" -msgstr "" - -msgid "" -"Specifies whether range_index is used or not. Note that it's a parameter for " -"test. It should not be used for production." -msgstr "" -"range_indexを使うかどうかを指定します。ただし、この引数はテスト用なので、本番" -"で使うべきではありません。" - -msgid "Dynamic column related parameters" -msgstr "動的カラム関連の引数" - -msgid "" -"All dynamic column related parameters in :doc:`select` are supported. See :" -"ref:`select-dynamic-column-related-parameters` for details." -msgstr "" -":doc:`select` のすべての動的カラム関連パラメーターをサポートしています。詳細" -"は :ref:`select-dynamic-column-related-parameters` を見てください。" - -msgid "" -"If you use one or more dynamic columns, \"stop searching when enough records " -"are matched in a table\" feature is disabled. (\"Stop searching against rest " -"tables when enough records are matched\" is still enabled.) " -"``logical_range_filter`` searches all matched records in a table even when " -"requested the number of matched records is small. It's for supporting window " -"function. Running window function requires all target records in a table." -msgstr "" -"動的カラムを1つ以上使うと、「十分なレコードがマッチしたらそのテーブルの検索を" -"切り上げる」機能が無効になります。(「十分なレコードがマッチしたら残りのテー" -"ブルの検索を切り上げる」機能は有効です。) ``logical_range_filter`` は要求さ" -"れているマッチレコード数が小さくても各テーブルですべてのマッチするレコードを" -"検索します。これはウィンドウ関数をサポートするためです。ウィンドウ関数を実行" -"するには同一テーブル内のすべての対象レコードが必要です。" - -msgid "``columns[${NAME}].stage``" -msgstr "" - -msgid "" -"Corresponds to :ref:`select-columns-name-stage` in :doc:`select`. See :ref:" -"`select-columns-name-stage` for details." -msgstr "" -":doc:`select` の :ref:`select-columns-name-stage` に対応しています。詳細は :" -"ref:`select-columns-name-stage` を見てください。" - -msgid "This is a required parameter." -msgstr "必須の引数です。" - -msgid "" -"Here is an example that creates ``is_popular`` column at ``initial`` stage. " -"You can use ``is_popular`` in all parameters such as ``filter`` and " -"``output_columns``:" -msgstr "" -"以下は ``initial`` ステージで ``is_popular`` カラムを作る例です。作成した " -"``is_popular`` カラムは ``filter`` や ``output_columns`` を含むすべてのパラ" -"メーターで使えます。" - -msgid "``columns[${NAME}].flags``" -msgstr "" - -msgid "" -"Corresponds to :ref:`select-columns-name-flags` in :doc:`select`. See :ref:" -"`select-columns-name-flags` for details." -msgstr "" -":doc:`select` の :ref:`select-columns-name-flags` に対応しています。詳細は :" -"ref:`select-columns-name-flags` を見てください。" - -msgid "The default value is ``COLUMN_SCALAR``." -msgstr "デフォルト値は ``COLUMN_SCALAR`` です。" - -msgid "" -"Here is an example that creates a vector column by ``COLUMN_VECTOR`` flags. " -"``plugin_register functions/vector`` is for using :doc:`/reference/functions/" -"vector_new` function:" -msgstr "" -"以下は ``COLUMN_VECTOR`` フラグを指定してベクターカラムを作る例です。 " -"``plugin_register functions/vector`` は :doc:`/reference/functions/" -"vector_new` 関数を使うために実行しています。:" - -msgid "``columns[${NAME}].type``" -msgstr "" - -msgid "" -"Corresponds to :ref:`select-columns-name-type` in :doc:`select`. See :ref:" -"`select-columns-name-type` for details." -msgstr "" -":doc:`select` の :ref:`select-columns-name-type` に対応しています。詳細は :" -"ref:`select-columns-name-type` を見てください。" - -msgid "" -"Here is an example that creates a ``ShortText`` type column. Stored value is " -"casted to ``ShortText`` automatically. In this example, number is casted to " -"``ShortText``:" -msgstr "" -"以下は ``ShortText`` 型のカラムを作る例です。保存された値は自動的に " -"``ShortText`` にキャストされます。この例では数値が ``ShortText`` にキャストさ" -"れています。" - -msgid "``columns[${NAME}].value``" -msgstr "" - -msgid "" -"Corresponds to :ref:`select-columns-name-value` in :doc:`select`. See :ref:" -"`select-columns-name-value` for details." -msgstr "" -":doc:`select` の :ref:`select-columns-name-value` に対応しています。詳細は :" -"ref:`select-columns-name-value` を見てください。" - -msgid "" -"You need to specify :doc:`/reference/window_function` as ``value`` value and " -"other window function related parameters when you use window function. See :" -"ref:`logical-range-filter-window-function-related-parameters` for details." -msgstr "" -"ウィンドウ関数を使う場合は、 ``value`` の値に :doc:`/reference/" -"window_function` を指定し、さらに他のウィンドウ関数関連のパラメーターも指定す" -"る必要があります。詳細は :ref:`logical-range-filter-window-function-related-" -"parameters` を見てください。" - msgid "" -"Here is an example that creates a new dynamic column that stores the number " -"of characters of content. This example uses :doc:`/reference/functions/" -"string_length` function in ``functions/string`` plugin to compute the number " -"of characters in a string. :doc:`plugin_register` is used to register " -"``functions/string`` plugin:" -msgstr "" -"以下は内容の文字数を格納するための動的カラムを1つ作る例です。この例では文字数" -"を数えるために ``functions/string`` プラグイン内の :doc:`/reference/" -"functions/string_length` 関数を使っています。 ``functions/string`` プラグイン" -"を登録するために :doc:`plugin_register` を使っています。" +"Specifies column name which is treated as shared key in each parted table." +msgstr "個々のテーブルで共通のキーとして扱うカラム名を指定します。" -msgid "Window function related parameters" -msgstr "ウィンドウ関数関連の引数" +msgid "Specifies the min value of ``shard_key``" +msgstr "``shard_key`` の最小値を指定します。" msgid "" -"All window function related parameters in :doc:`select` are supported. See :" -"ref:`select-window-function-related-parameters` for details." +"Specifies whether the min value of borderline must be include or not. " +"Specify ``include`` or ``exclude`` as the value of this parameter." msgstr "" -":doc:`select` のすべてのウィンドウ関数関連パラメーターをサポートしています。" -"詳細は :ref:`select-window-function-related-parameters` を見てください。" +"最小値を境界値として含めるのか否かを指定します。 ``include`` もしくは " +"``exclude`` を指定します。" -msgid "Window function over multiple tables aren't supported yet." -msgstr "複数のテーブルをまたがったウィンドウ関数はまだサポートしていません。" +msgid "Specifies the max value of ``shard_key``." +msgstr "``shard_key`` の最大値を指定します。" -msgid "``columns[${NAME}].window.sort_keys``" +msgid "" +"Specifies whether the max value of borderline must be include or not. " +"Specify ``include`` or ``exclude`` as the value of this parameter." msgstr "" +"最大値を境界値として含めるのか否かを指定します。 ``include`` もしくは " +"``exclude`` を指定します。" -msgid "" -"Corresponds to :ref:`select-columns-name-window-sort-keys` in :doc:`select`. " -"See :ref:`select-columns-name-window-sort-keys` for details." +msgid "``order``" msgstr "" -":doc:`select` の :ref:`select-columns-name-window-sort-keys` に対応していま" -"す。詳細は :ref:`select-columns-name-window-sort-keys` を見てください。" + +msgid "Output related parameters" +msgstr "出力関連の引数" msgid "" -"You must specify :ref:`logical-range-filter-columns-name-window-sort-keys` " -"or :ref:`logical-range-filter-columns-name-window-group-keys` to use window " -"function." +"Corresponds to :ref:`select-output-columns` in :doc:`select`. See :ref:" +"`select-output-columns` for details." msgstr "" -"ウィンドウ関数を使うには :ref:`logical-range-filter-columns-name-window-sort-" -"keys` または :ref:`logical-range-filter-columns-name-window-group-keys` を指" -"定しなければいけません。" +":doc:`select` の :ref:`select-output-columns` に対応しています。詳細は :ref:" +"`select-output-columns` を見てください。" msgid "" -"Here is an example that computes cumulative sum per ``Entries.tag``. Each " -"group is sorted by ``Entries._key``:" +"Corresponds to :ref:`select-offset` in :doc:`select`. See :ref:`select-" +"offset` for details." msgstr "" -"以下は ``Entries.tag`` 毎に累積和を計算する例です。各グループ内のレコードは " -"``Entries._key`` でソートします。" +":doc:`select` の :ref:`select-offset` に対応しています。詳細は :ref:`select-" +"offset` を見てください。" -msgid "``columns[${NAME}].window.group_keys``" +msgid "" +"Corresponds to :ref:`select-limit` in :doc:`select`. See :ref:`select-limit` " +"for details." msgstr "" +":doc:`select` の :ref:`select-limit` に対応しています。詳細は :ref:`select-" +"limit` を見てください。" msgid "" -"Corresponds to :ref:`select-columns-name-window-group-keys` in :doc:" -"`select`. See :ref:`select-columns-name-window-group-keys` for details." +"The difference from :doc:`select` is that this command stops searching when " +"all requested records specified by :ref:`logical-range-filter-offset` and :" +"ref:`logical-range-filter-limit` are found." msgstr "" -":doc:`select` の :ref:`select-columns-name-window-group-keys` に対応していま" -"す。詳細は :ref:`select-columns-name-window-group-keys` を見てください。" - -msgid "Here is an example that computes sum per ``Entries.tag``:" -msgstr "以下は ``Entries.tag`` 毎に合計を計算する例です。" +":doc:`select` との違いは、このコマンドは :ref:`logical-range-filter-offset` " +"と :ref:`logical-range-filter-limit` で指定したレコードを見つけたら検索を終了" +"することです。" -msgid "Cache related parameter" -msgstr "キャッシュ関連の引数" +msgid "Test related parameters" +msgstr "テスト関連の引数" -msgid "``cache``" +msgid "``use_range_index``" msgstr "" -msgid "Specifies whether caching the result of this query or not." -msgstr "このクエリーの結果をキャッシュするかどうかを指定します。" - msgid "" -"If the result of this query is cached, the next same query returns response " -"quickly by using the cache." +"Specifies whether range_index is used or not. Note that it's a parameter for " +"test. It should not be used for production." msgstr "" -"このクエリーの結果がキャッシュしてあると、次に同じクエリーを実行するときは" -"キャッシュを使って高速にレスポンスを返すことができます。" +"range_indexを使うかどうかを指定します。ただし、この引数はテスト用なので、本番" +"で使うべきではありません。" -msgid "It doesn't control whether existing cached result is used or not." +msgid "" +"If you use one or more dynamic columns, \"stop searching when enough records " +"are matched in a table\" feature is disabled. (\"Stop searching against rest " +"tables when enough records are matched\" is still enabled.) " +"``logical_range_filter`` searches all matched records in a table even when " +"requested the number of matched records is small. It's for supporting window " +"function. Running window function requires all target records in a table." msgstr "" -"これは既存のキャッシュされた結果を使うかどうかを指定するものではありません。" +"動的カラムを1つ以上使うと、「十分なレコードがマッチしたらそのテーブルの検索を" +"切り上げる」機能が無効になります。(「十分なレコードがマッチしたら残りのテー" +"ブルの検索を切り上げる」機能は有効です。) ``logical_range_filter`` は要求さ" +"れているマッチレコード数が小さくても各テーブルですべてのマッチするレコードを" +"検索します。これはウィンドウ関数をサポートするためです。ウィンドウ関数を実行" +"するには同一テーブル内のすべての対象レコードが必要です。" -msgid "``no``" +msgid "" +"Here is an example that creates ``is_popular`` column at ``initial`` stage. " +"You can use ``is_popular`` in all parameters such as ``filter`` and " +"``output_columns``:" msgstr "" +"以下は ``initial`` ステージで ``is_popular`` カラムを作る例です。作成した " +"``is_popular`` カラムは ``filter`` や ``output_columns`` を含むすべてのパラ" +"メーターで使えます。" -msgid "Don't cache the output of this query." -msgstr "このクエリーの出力をキャッシュしない。" - -msgid "``yes``" +msgid "" +"You need to specify :doc:`/reference/window_function` as ``value`` value and " +"other window function related parameters when you use window function. See :" +"ref:`logical-range-filter-window-function-related-parameters` for details." msgstr "" +"ウィンドウ関数を使う場合は、 ``value`` の値に :doc:`/reference/" +"window_function` を指定し、さらに他のウィンドウ関数関連のパラメーターも指定す" +"る必要があります。詳細は :ref:`logical-range-filter-window-function-related-" +"parameters` を見てください。" -msgid "Cache the output of this query. It's the default value." -msgstr "このクエリーの出力をキャッシュする。デフォルト値。" - -msgid "Here is an example to disable caching the result of this query:" -msgstr "このクエリーの結果をキャッシュしないようにする例です。" - -msgid "The command returns a response with the following format::" -msgstr "このコマンドは以下のフォーマットのレスポンスを返します::" +msgid "" +"You must specify :ref:`logical-range-filter-columns-name-window-sort-keys` " +"or :ref:`logical-range-filter-columns-name-window-group-keys` to use window " +"function." +msgstr "" +"ウィンドウ関数を使うには :ref:`logical-range-filter-columns-name-window-sort-" +"keys` または :ref:`logical-range-filter-columns-name-window-group-keys` を指" +"定しなければいけません。" msgid "" "``COLUMNS`` describes about output columns specified by :ref:`logical-range-" @@ -7819,13 +7952,6 @@ msgstr "" "``logical_select`` は複数のテーブルからレコードを検索し、マッチしたレコードを" "出力します。" -msgid "" -"The required parameters are ``logical_table`` and ``shard_key``. Other " -"parameters are optional::" -msgstr "" -"必須の引数は ``logical_table`` と ``shard_key`` です。それ以外の引数は省略可" -"能です::" - msgid "This command has the following named parameters for advanced drilldown:" msgstr "" "このコマンドには高度なドリルダウン機能のために以下の名前付き引数があります。" @@ -7990,118 +8116,12 @@ msgstr "" "``logical_table`` と ``shard_key`` 引数を指定すると10レコード表示できます。こ" "れらの引数は必須の引数です。" -msgid "If nonexistent table is specified, an error is returned." -msgstr "存在しないテーブルを指定するとエラーが返ります。" - -msgid "" -"Specifies column name which is treated as shared key. Shard key is a column " -"that stores data that is used for distributing records to suitable shards." -msgstr "" -"シャードキーとして使うカラム名を指定します。シャードキーは適切なシャードへレ" -"コードを分配するために使う値を保存しているカラムです。" - -msgid "Shard key must be ``Time`` type for now." -msgstr "今のところ、シャードキーは ``Time`` 型でなければいけません。" - msgid "See :ref:`logical-select-logical-table` how to specify ``shard_key``." msgstr "" "``shard_key`` の指定方法は :ref:`logical-select-logical-table` を見てくださ" "い。" msgid "" -"Specifies the minimum value of ``shard_key`` column. If shard doesn't have " -"any matched records, the shard isn't searched." -msgstr "" -"``shard_key`` カラムの最小値を指定します。シャードにマッチするレコードがない" -"場合は、そのシャードは検索対象外になります。" - -msgid "" -"For example, ``min`` is ``\"2015/07/09 00:00:00\"``, ``Entry_20150708`` " -"isn't searched. Because ``Entry_20150708`` has only records for ``" -"\"2015/07/08\"``." -msgstr "" -"たとえば、 ``min`` が ``\"2015/07/09 00:00:00\"`` なら、 ``Entry_20150708`` " -"は検索対象外です。なぜなら、 ``Entry_20150708`` は ``\"2015/07/08\"`` のレ" -"コードしかないからです。" - -msgid "" -"The following example only uses ``Entry_20150709`` table. ``Entry_20150708`` " -"isn't used." -msgstr "" -"以下の例は ``Entry_20150709`` テーブルだけを使う例です。 ``Entry_20150708`` " -"は使われません。" - -msgid "" -"Specifies whether the minimum value is included or not. Here is available " -"values." -msgstr "最小値を含めるかどうかを指定します。指定可能な値は次の通りです。" - -msgid "``include``" -msgstr "" - -msgid "Includes ``min`` value. This is the default." -msgstr "``min`` の値を含みます。これがデフォルト値です。" - -msgid "``exclude``" -msgstr "" - -msgid "Doesn't include ``min`` value." -msgstr "``min`` の値を含みません。" - -msgid "" -"Here is an example for ``exclude``. The result doesn't include the ``\"Good-" -"bye Senna\"`` record because its ``created_at`` value is ``\"2015/07/09 " -"00:00:00\"``." -msgstr "" -"次の例は ``exclude`` の使用例です。結果には ``\"Good-bye Senna\"`` レコードは" -"含まれません。このレコードの ``created_at`` の値が ``\"2015/07/09 " -"00:00:00\"`` だからです。" - -msgid "" -"Specifies the maximum value of ``shard_key`` column. If shard doesn't have " -"any matched records, the shard isn't searched." -msgstr "" -"``shard_key`` カラムの最大値を指定します。シャードにマッチするレコードがない" -"場合、そのシャードは検索対象外になります。" - -msgid "" -"For example, ``max`` is ``\"2015/07/08 23:59:59\"``, ``Entry_20150709`` " -"isn't searched. Because ``Entry_20150709`` has only records for ``" -"\"\"2015/07/09\"``." -msgstr "" -"たとえば、 ``max`` が ``\"2015/07/08 23:59:59\"`` なら ``Entry_20150709`` は" -"検索対象外です。なぜなら ``Entry_20150709`` には ``\"\"2015/07/09\"`` のレ" -"コードしかないからです。" - -msgid "" -"The following example only uses ``Entry_20150708`` table. ``Entry_20150709`` " -"isn't used." -msgstr "" -"以下の例は ``Entry_20150708`` テーブルだけを使います。 ``Entry_20150709`` は" -"使いません。" - -msgid "" -"Specifies whether the maximum value is included or not. Here is available " -"values." -msgstr "最大値を含めるかどうかを指定します。指定可能な値は次の通りです。" - -msgid "Includes ``max`` value. This is the default." -msgstr "``max`` の値を含みます。これがデフォルト値です。" - -msgid "Doesn't include ``max`` value." -msgstr "``max`` の値を含みません。" - -msgid "Search related parameters" -msgstr "検索関係の引数" - -msgid "" -"``logical_select`` provides :doc:`select` compatible search related " -"parameters." -msgstr "" -"``logical_select`` は :doc:`select` 互換の検索関連パラメーターをサポートして" -"います。" - -msgid "" "Corresponds to :ref:`select-match-columns` in :doc:`select`. See :ref:" "`select-match-columns` for details." msgstr "" @@ -8125,13 +8145,6 @@ msgstr "" msgid "See also :ref:`logical-select-match-columns`." msgstr ":ref:`logical-select-match-columns` も参照してください。" -msgid "" -"Corresponds to :ref:`select-filter` in :doc:`select`. See :ref:`select-" -"filter` for details." -msgstr "" -":doc:`select` の :ref:`select-filter` に対応しています。詳細は :ref:`select-" -"filter` を見てください。" - msgid "Advanced search parameters" msgstr "高度な検索のための引数" @@ -14545,9 +14558,6 @@ msgstr "" "WindowsはWindowsをシャットダウンするときに時間内に終了しないサービスを強制終" "了します。" -msgid "This section describes parameters of this command." -msgstr "このセクションではこのコマンドのパラメーターを説明します。" - msgid "``mode``" msgstr "" Added: doc/source/example/reference/commands/logical_count/cache_no.log (+7 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/cache_no.log 2017-11-07 16:48:30 +0900 (f8b4cd845) @@ -0,0 +1,7 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --cache no + # [[0, 1337566253.89858, 0.000355720520019531], 5] Added: doc/source/example/reference/commands/logical_count/columns_name_flags.log (+13 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/columns_name_flags.log 2017-11-07 16:48:30 +0900 (87cfc220e) @@ -0,0 +1,13 @@ +Execution example:: + + plugin_register functions/vector + # [[0, 1337566253.89858, 0.000355720520019531], true] + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --columns[vector].stage initial \ + --columns[vector].flags COLUMN_VECTOR \ + --columns[vector].type UInt32 \ + --columns[vector].value 'vector_new(1, 2, 3)' \ + --filter 'vector_size(vector) > 2' + # [[0, 1337566253.89858, 0.000355720520019531], 5] Added: doc/source/example/reference/commands/logical_count/columns_name_stage.log (+10 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/columns_name_stage.log 2017-11-07 16:48:30 +0900 (b5365e8de) @@ -0,0 +1,10 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --columns[is_popular].stage initial \ + --columns[is_popular].type Bool \ + --columns[is_popular].value 'n_likes >= 10' \ + --filter is_popular + # [[0, 1337566253.89858, 0.000355720520019531], 2] Added: doc/source/example/reference/commands/logical_count/columns_name_type.log (+10 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/columns_name_type.log 2017-11-07 16:48:30 +0900 (194251488) @@ -0,0 +1,10 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --columns[n_likes_string].stage initial \ + --columns[n_likes_string].type ShortText \ + --columns[n_likes_string].value n_likes \ + --filter 'n_likes_string == "3"' + # [[0, 1337566253.89858, 0.000355720520019531], 2] Added: doc/source/example/reference/commands/logical_count/columns_name_value.log (+12 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/columns_name_value.log 2017-11-07 16:48:30 +0900 (df585afa9) @@ -0,0 +1,12 @@ +Execution example:: + + plugin_register functions/string + # [[0, 1337566253.89858, 0.000355720520019531], true] + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --columns[content_length].stage initial \ + --columns[content_length].type UInt32 \ + --columns[content_length].value 'string_length(content)' \ + --filter 'content_length >= 40' + # [[0, 1337566253.89858, 0.000355720520019531], 2] Added: doc/source/example/reference/commands/logical_count/columns_name_window_group_keys.log (+11 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/columns_name_window_group_keys.log 2017-11-07 16:48:30 +0900 (54aec74d2) @@ -0,0 +1,11 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --columns[n_likes_sum_per_tag].stage initial \ + --columns[n_likes_sum_per_tag].type UInt32 \ + --columns[n_likes_sum_per_tag].value 'window_sum(n_likes)' \ + --columns[n_likes_sum_per_tag].window.group_keys tag \ + --filter 'n_likes_sum_per_tag > 5' + # [[0, 1337566253.89858, 0.000355720520019531], 4] Added: doc/source/example/reference/commands/logical_count/columns_name_window_sort_keys.log (+12 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/columns_name_window_sort_keys.log 2017-11-07 16:48:30 +0900 (f9662a252) @@ -0,0 +1,12 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --columns[n_likes_cumulative_sum_per_tag].stage initial \ + --columns[n_likes_cumulative_sum_per_tag].type UInt32 \ + --columns[n_likes_cumulative_sum_per_tag].value 'window_sum(n_likes)' \ + --columns[n_likes_cumulative_sum_per_tag].window.sort_keys _key \ + --columns[n_likes_cumulative_sum_per_tag].window.group_keys tag \ + --filter 'n_likes_cumulative_sum_per_tag > 5' + # [[0, 1337566253.89858, 0.000355720520019531], 3] Added: doc/source/example/reference/commands/logical_count/filter.log (+7 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/filter.log 2017-11-07 16:48:30 +0900 (1f16fec4a) @@ -0,0 +1,7 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --filter "n_likes <= 5" + # [[0, 1337566253.89858, 0.000355720520019531], 3] Added: doc/source/example/reference/commands/logical_count/logical_table_existent.log (+6 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/logical_table_existent.log 2017-11-07 16:48:30 +0900 (48304a30a) @@ -0,0 +1,6 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at + # [[0, 1337566253.89858, 0.000355720520019531], 5] Added: doc/source/example/reference/commands/logical_count/logical_table_nonexistent.log (+20 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/logical_table_nonexistent.log 2017-11-07 16:48:30 +0900 (f10613eb7) @@ -0,0 +1,20 @@ +Execution example:: + + logical_count \ + --logical_table Nonexistent \ + --shard_key created_at + # [ + # [ + # -22, + # 1337566253.89858, + # 0.000355720520019531, + # "[logical_count] no shard exists: logical_table: <Nonexistent>: shard_key: <created_at>", + # [ + # [ + # "Groonga::Sharding::LogicalCountCommand.run_body", + # "/home/kou/work/c/groonga.clean/plugins/sharding/logical_count.rb", + # 30 + # ] + # ] + # ] + # ] Added: doc/source/example/reference/commands/logical_count/max.log (+7 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/max.log 2017-11-07 16:48:30 +0900 (ea1ae5b2f) @@ -0,0 +1,7 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --max "2015/07/08 23:59:59" + # [[0, 1337566253.89858, 0.000355720520019531], 3] Added: doc/source/example/reference/commands/logical_count/max_border.log (+8 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/max_border.log 2017-11-07 16:48:30 +0900 (c3877521e) @@ -0,0 +1,8 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --max "2015/07/09 00:00:00" \ + --max_border "exclude" + # [[0, 1337566253.89858, 0.000355720520019531], 3] Added: doc/source/example/reference/commands/logical_count/min.log (+7 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/min.log 2017-11-07 16:48:30 +0900 (2dfcc7c5d) @@ -0,0 +1,7 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --min "2015/07/09 00:00:00" + # [[0, 1337566253.89858, 0.000355720520019531], 2] Added: doc/source/example/reference/commands/logical_count/min_border.log (+8 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/min_border.log 2017-11-07 16:48:30 +0900 (89caefc00) @@ -0,0 +1,8 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --min "2015/07/09 00:00:00" \ + --min_border "exclude" + # [[0, 1337566253.89858, 0.000355720520019531], 1] Added: doc/source/example/reference/commands/logical_count/usage.log (+7 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/usage.log 2017-11-07 16:48:30 +0900 (ce9d6cedb) @@ -0,0 +1,7 @@ +Execution example:: + + logical_count \ + --logical_table Entries \ + --shard_key created_at \ + --filter 'query("content", "Groonga OR Senna")' + # [[0, 1337566253.89858, 0.000355720520019531], 2] Added: doc/source/example/reference/commands/logical_count/usage_plugin_register.log (+4 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/logical_count/usage_plugin_register.log 2017-11-07 16:48:30 +0900 (6315f95d1) @@ -0,0 +1,4 @@ +Execution example:: + + plugin_register sharding + # [[0, 1337566253.89858, 0.000355720520019531], true] Modified: doc/source/reference/commands/logical_count.rst (+503 -71) =================================================================== --- doc/source/reference/commands/logical_count.rst 2017-11-07 16:15:51 +0900 (7f1ea02be) +++ doc/source/reference/commands/logical_count.rst 2017-11-07 16:48:30 +0900 (6faf47ed3) @@ -13,112 +13,172 @@ Summary .. versionadded:: 5.0.0 -``logical_count`` is a command to count matched records even though actual records are stored into parted tables. It is useful for users because there is less need to care about maximum records of table :doc:`/limitations`. - -Note that this feature is not matured yet, so there are some limitations. - -* Create parted tables which contains "_YYYYMMDD" postfix. It is hardcoded, so you must create tables by each day. -* Load proper data into parted tables on your own. +``logical_count`` is a command that has only count feature in +:doc:`logical_select`. :doc:`logical_select` searches records from +multiple tables, outputs the number of matched records, outputs +columns of the matched records and so on. ``logical_count`` only +searches records from multiple tables and output the number of matched +records. + +``logical_count`` is useful when you just want the number of matched +records. You can use ``logical_count`` and :doc:`logical_range_filter` +at once. You can show the first N matched records before you get the +number of matched records. If you use only :doc:`logical_select`, you +need to wait finishing all search. + +You need to :doc:`plugin_register` ``sharding`` plugin because +this command is included in ``sharding`` plugin. Syntax ------ This command takes many parameters. -The required parameters are ``logical_table`` and ``shard_key``:: +The required parameters are ``logical_table`` and ``shard_key``. Other +parameters are optional:: - logical_count logical_table - shard_key - [min] - [min_border] - [max] - [max_border] - [filter] + logical_count + logical_table + shard_key + [min=null] + [min_border="include"] + [max=null] + [max_border="include"] + [filter=null] + +.. _logical-count-usage: Usage ----- -Register ``sharding`` plugin to use ``logical_count`` command in advance. +Let's learn about usage with examples. This section shows many popular +usages. + +You need to register ``sharding`` plugin because this command is +included in ``sharding`` plugin. .. groonga-command +.. include:: ../../example/reference/commands/logical_count/usage_plugin_register.log .. plugin_register sharding + Note that ``logical_count`` is implemented as an experimental plugin, and the specification may be changed in the future. Here is the simple example which shows how to use this feature. Let's consider to count specified logs which are stored into multiple tables. -Here is the schema and data. - -.. groonga-command -.. include:: ../../example/reference/commands/logical_count/setup_schema.log -.. table_create Logs_20150203 TABLE_NO_KEY -.. column_create Logs_20150203 timestamp COLUMN_SCALAR Time -.. column_create Logs_20150203 message COLUMN_SCALAR Text -.. table_create Logs_20150204 TABLE_NO_KEY -.. column_create Logs_20150204 timestamp COLUMN_SCALAR Time -.. column_create Logs_20150204 message COLUMN_SCALAR Text -.. table_create Logs_20150205 TABLE_NO_KEY -.. column_create Logs_20150205 timestamp COLUMN_SCALAR Time -.. column_create Logs_20150205 message COLUMN_SCALAR Text +Here are a schema definition and sample data to show usage. .. groonga-command -.. include:: ../../example/reference/commands/logical_count/setup_data.log -.. load --table Logs_20150203 -.. [ -.. {"timestamp": "2015-02-03 23:59:58", "message": "Start"}, -.. {"timestamp": "2015-02-03 23:59:58", "message": "Shutdown"}, -.. {"timestamp": "2015-02-03 23:59:59", "message": "Start"}, -.. {"timestamp": "2015-02-03 23:59:59", "message": "Shutdown"} -.. ] -.. load --table Logs_20150204 +.. include:: ../../example/reference/commands/logical_select/usage_setup.log +.. table_create Entries_20150708 TABLE_HASH_KEY ShortText +.. column_create Entries_20150708 created_at COLUMN_SCALAR Time +.. column_create Entries_20150708 content COLUMN_SCALAR Text +.. column_create Entries_20150708 n_likes COLUMN_SCALAR UInt32 +.. column_create Entries_20150708 tag COLUMN_SCALAR ShortText +.. +.. table_create Entries_20150709 TABLE_HASH_KEY ShortText +.. column_create Entries_20150709 created_at COLUMN_SCALAR Time +.. column_create Entries_20150709 content COLUMN_SCALAR Text +.. column_create Entries_20150709 n_likes COLUMN_SCALAR UInt32 +.. column_create Entries_20150709 tag COLUMN_SCALAR ShortText +.. +.. table_create Terms TABLE_PAT_KEY ShortText \ +.. --default_tokenizer TokenBigram \ +.. --normalizer NormalizerAuto +.. column_create Terms entries_key_index_20150708 \ +.. COLUMN_INDEX|WITH_POSITION Entries_20150708 _key +.. column_create Terms entries_content_index_20150708 \ +.. COLUMN_INDEX|WITH_POSITION Entries_20150708 content +.. column_create Terms entries_key_index_20150709 \ +.. COLUMN_INDEX|WITH_POSITION Entries_20150709 _key +.. column_create Terms entries_content_index_20150709 \ +.. COLUMN_INDEX|WITH_POSITION Entries_20150709 content +.. +.. load --table Entries_20150708 .. [ -.. {"timestamp": "2015-02-04 00:00:00", "message": "Start"}, -.. {"timestamp": "2015-02-04 00:00:00", "message": "Shutdown"}, -.. {"timestamp": "2015-02-04 00:00:01", "message": "Start"}, -.. {"timestamp": "2015-02-04 00:00:01", "message": "Shutdown"}, -.. {"timestamp": "2015-02-04 23:59:59", "message": "Start"}, -.. {"timestamp": "2015-02-04 23:59:59", "message": "Shutdown"} +.. {"_key": "The first post!", +.. "created_at": "2015/07/08 00:00:00", +.. "content": "Welcome! This is my first post!", +.. "n_likes": 5, +.. "tag": "Hello"}, +.. {"_key": "Groonga", +.. "created_at": "2015/07/08 01:00:00", +.. "content": "I started to use Groonga. It's very fast!", +.. "n_likes": 10, +.. "tag": "Groonga"}, +.. {"_key": "Mroonga", +.. "created_at": "2015/07/08 02:00:00", +.. "content": "I also started to use Mroonga. It's also very fast! Really fast!", +.. "n_likes": 15, +.. "tag": "Groonga"} .. ] -.. load --table Logs_20150205 +.. +.. load --table Entries_20150709 .. [ -.. {"timestamp": "2015-02-05 00:00:00", "message": "Start"}, -.. {"timestamp": "2015-02-05 00:00:00", "message": "Shutdown"}, -.. {"timestamp": "2015-02-05 00:00:01", "message": "Start"}, -.. {"timestamp": "2015-02-05 00:00:01", "message": "Shutdown"} +.. {"_key": "Good-bye Senna", +.. "created_at": "2015/07/09 00:00:00", +.. "content": "I migrated all Senna system!", +.. "n_likes": 3, +.. "tag": "Senna"}, +.. {"_key": "Good-bye Tritonn", +.. "created_at": "2015/07/09 01:00:00", +.. "content": "I also migrated all Tritonn system!", +.. "n_likes": 3, +.. "tag": "Senna"} .. ] -There are three tables which are mapped each day from 2015 Feb 03 to 2015 Feb 05. +There are two tables, ``Entries_20150708`` and ``Entries_20150709``, +for blog entries. + +.. note:: + + You need to use ``${LOGICAL_TABLE_NAME}_${YYYYMMDD}`` naming rule + for table names. In this example, ``LOGICAL_TABLE_NAME`` is + ``Entries`` and ``YYYYMMDD`` is ``20150708`` or ``20150709``. -* Logs_20150203 -* Logs_20150204 -* Logs_20150205 +An entry has title, created time, content, the number of likes for the +entry and tag. Title is key of ``Entries_YYYYMMDD``. Created time is +value of ``Entries_YYYYMMDD.created_at`` column. Content is value of +``Entries_YYYYMMDD.content`` column. The number of likes is value of +``Entries_YYYYMMDD.n_likes`` column. Tag is value of +``Entries_YYYYMMDD.tag`` column. -Then, it loads data into each table which correspond to. +``Entries_YYYYMMDD._key`` column and ``Entries_YYYYMMDD.content`` +column are indexed using ``TokenBigram`` tokenizer. So both +``Entries_YYYYMMDD._key`` and ``Entries_YYYYMMDD.content`` are +fulltext search ready. -Let's count logs which contains "Shutdown" in ``message`` column and the value of timestamp is "2015-02-04 00:00:00" or later. +OK. The schema and data for examples are ready. -Here is the query to achieve above purpose. +Here is an example to count the number of records which have +``Groonga`` or ``Senna`` in ``content`` column. ``logical_count`` +searches records over all ``Entries_YYYYMMDD`` tables. .. groonga-command -.. include:: ../../example/reference/commands/logical_count/count_shutdown.log -.. logical_count Logs timestamp --filter 'message == "Shutdown"' --min "2015-02-04 00:00:00" --min_border "include" +.. include:: ../../example/reference/commands/logical_count/usage.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --filter 'query("content", "Groonga OR Senna")' -There is a well known limitation about the number of records. By sharding feature, you can overcome such limitations because such a limitation is applied per table. +Here are matched records: -.. note:: + * ``_key:"Groonga"`` in ``Entries_20150708`` - There is no convenient query such as ``PARTITIONING BY`` in SQL. Thus, you must create table by ``table_create`` for each tables which contains "_YYYYMMDD" postfix in table name. + * ``_key:"Good-bye Senna"`` in ``Entries_20150709`` Parameters ---------- -This section describes parameters of ``logical_count``. +This section describes parameters of this command. Required parameters ^^^^^^^^^^^^^^^^^^^ There are required parameters, ``logical_table`` and ``shard_key``. +.. _logical-count-logical-table: + ``logical_table`` """"""""""""""""" @@ -127,47 +187,419 @@ Specifies logical table name. It means table name without ``Logs_20150203``, ``Logs_20150203`` and so on, logical table name is ``Logs``. +You can count all records by specifying only ``logical_table`` and +``shard_key`` parameters. They are required parameters. + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/logical_table_existent.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at + +If nonexistent table is specified, an error is returned. + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/logical_table_nonexistent.log +.. logical_count \ +.. --logical_table Nonexistent \ +.. --shard_key created_at + +.. _logical-count-shard-key: + ``shard_key`` """"""""""""" -Specifies column name which is treated as shared key in each parted table. +Specifies column name which is treated as shared key. Shard key is a +column that stores data that is used for distributing records to +suitable shards. + +Shard key must be ``Time`` type for now. + +See :ref:`logical-count-logical-table` how to specify ``shard_key``. Optional parameters ^^^^^^^^^^^^^^^^^^^ There are optional parameters. +.. _logical-count-min: + ``min`` """"""" -Specifies the min value of ``shard_key`` +Specifies the minimum value of ``shard_key`` column. If shard doesn't +have any matched records, the shard isn't searched. + +For example, ``min`` is ``"2015/07/09 00:00:00"``, ``Entry_20150708`` +isn't searched. Because ``Entry_20150708`` has only records for +``"2015/07/08"``. + +The following example only uses ``Entry_20150709`` +table. ``Entry_20150708`` isn't used. + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/min.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --min "2015/07/09 00:00:00" + +.. _logical-count-min-border: ``min_border`` """""""""""""" -Specifies whether the min value of borderline must be include or not. -Specify ``include`` or ``exclude`` as the value of this parameter. +Specifies whether the minimum value is included or not. Here is +available values. + +.. list-table:: + :header-rows: 1 + + * - Value + - Description + * - ``include`` + - Includes ``min`` value. This is the default. + * - ``exclude`` + - Doesn't include ``min`` value. + +Here is an example for ``exclude``. The result doesn't include the +``"Good-bye Senna"`` record because its ``created_at`` value is +``"2015/07/09 00:00:00"``. + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/min_border.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --min "2015/07/09 00:00:00" \ +.. --min_border "exclude" + +.. _logical-count-max: ``max`` """"""" -Specifies the max value of ``shard_key``. +Specifies the maximum value of ``shard_key`` column. If shard doesn't +have any matched records, the shard isn't searched. + +For example, ``max`` is ``"2015/07/08 23:59:59"``, ``Entry_20150709`` +isn't searched. Because ``Entry_20150709`` has only records for +``""2015/07/09"``. + +The following example only uses ``Entry_20150708`` +table. ``Entry_20150709`` isn't used. + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/max.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --max "2015/07/08 23:59:59" + +.. _logical-count-max-border: ``max_border`` """""""""""""" -Specifies whether the max value of borderline must be include or not. -Specify ``include`` or ``exclude`` as the value of this parameter. +Specifies whether the maximum value is included or not. Here is +available values. + +.. list-table:: + :header-rows: 1 + + * - Value + - Description + * - ``include`` + - Includes ``max`` value. This is the default. + * - ``exclude`` + - Doesn't include ``max`` value. + +Here is an example for ``exclude``. The result doesn't include the +``"Good-bye Senna"`` record because its ``created_at`` value is +``"2015/07/09 00:00:00"``. + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/max_border.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --max "2015/07/09 00:00:00" \ +.. --max_border "exclude" + +.. _logical-count-search-related-parameters: + +Search related parameters +^^^^^^^^^^^^^^^^^^^^^^^^^ + +This command provides :doc:`select` compatible search related +parameters. + +.. _logical-count-filter: ``filter`` """""""""" +Corresponds to :ref:`select-filter` in :doc:`select`. See +:ref:`select-filter` for details. + +Here is an example: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/filter.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --filter "n_likes <= 5" + +.. _logical-count-dynamic-column-related-parameters: + +Dynamic column related parameters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. versionadded:: 7.0.9 + +All dynamic column related parameters in :doc:`select` are +supported. See :ref:`select-dynamic-column-related-parameters` for +details. + +.. _logical-count-columns-name-stage: + +``columns[${NAME}].stage`` +"""""""""""""""""""""""""" + +.. versionadded:: 7.0.9 + +Corresponds to :ref:`select-columns-name-stage` in :doc:`select`. See +:ref:`select-columns-name-stage` for details. + +This is a required parameter. + +Only ``initial`` stage is valid. Because there are no processes after +``filtered`` and ``output`` stages. + +Here is an example that creates ``is_popular`` column at ``initial`` +stage. You can use ``is_popular`` in all parameters such as ``filter``: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/columns_name_stage.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --columns[is_popular].stage initial \ +.. --columns[is_popular].type Bool \ +.. --columns[is_popular].value 'n_likes >= 10' \ +.. --filter is_popular + +.. _logical-count-columns-name-flags: + +``columns[${NAME}].flags`` +"""""""""""""""""""""""""" + +.. versionadded:: 7.0.9 + +Corresponds to :ref:`select-columns-name-flags` in :doc:`select`. See +:ref:`select-columns-name-flags` for details. + +The default value is ``COLUMN_SCALAR``. + +Here is an example that creates a vector column by ``COLUMN_VECTOR`` +flags. ``plugin_register functions/vector`` is for using +:doc:`/reference/functions/vector_new` function: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/columns_name_flags.log +.. plugin_register functions/vector +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --columns[vector].stage initial \ +.. --columns[vector].flags COLUMN_VECTOR \ +.. --columns[vector].type UInt32 \ +.. --columns[vector].value 'vector_new(1, 2, 3)' \ +.. --filter 'vector_size(vector) > 2' + +.. _logical-count-columns-name-type: + +``columns[${NAME}].type`` +""""""""""""""""""""""""" + +.. versionadded:: 7.0.9 + +Corresponds to :ref:`select-columns-name-type` in :doc:`select`. See +:ref:`select-columns-name-type` for details. + +This is a required parameter. + +Here is an example that creates a ``ShortText`` type column. Stored +value is casted to ``ShortText`` automatically. In this example, +number is casted to ``ShortText``: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/columns_name_type.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --columns[n_likes_string].stage initial \ +.. --columns[n_likes_string].type ShortText \ +.. --columns[n_likes_string].value n_likes \ +.. --filter 'n_likes_string == "3"' + +.. _logical-count-columns-name-value: + +``columns[${NAME}].value`` +"""""""""""""""""""""""""" + +.. versionadded:: 7.0.9 + +Corresponds to :ref:`select-columns-name-value` in :doc:`select`. See +:ref:`select-columns-name-value` for details. + +You need to specify :doc:`/reference/window_function` as ``value`` +value and other window function related parameters when you use window +function. See :ref:`logical-count-window-function-related-parameters` +for details. + +This is a required parameter. + +Here is an example that creates a new dynamic column that stores the +number of characters of content. This example uses +:doc:`/reference/functions/string_length` function in +``functions/string`` plugin to compute the number of characters in a +string. :doc:`plugin_register` is used to register +``functions/string`` plugin: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/columns_name_value.log +.. plugin_register functions/string +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --columns[content_length].stage initial \ +.. --columns[content_length].type UInt32 \ +.. --columns[content_length].value 'string_length(content)' \ +.. --filter 'content_length >= 40' + +.. _logical-count-window-function-related-parameters: + +Window function related parameters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. versionadded:: 7.0.9 + +All window function related parameters in :doc:`select` are +supported. See :ref:`select-window-function-related-parameters` for +details. + +.. note:: + + Window function over multiple tables aren't supported yet. + +.. _logical-count-columns-name-window-sort-keys: + +``columns[${NAME}].window.sort_keys`` +""""""""""""""""""""""""""""""""""""" + +.. versionadded:: 7.0.9 + +Corresponds to :ref:`select-columns-name-window-sort-keys` in +:doc:`select`. See :ref:`select-columns-name-window-sort-keys` for +details. + +You must specify :ref:`logical-count-columns-name-window-sort-keys` +or :ref:`logical-count-columns-name-window-group-keys` to use window +function. + +Here is an example that computes cumulative sum per +``Entries.tag``. Each group is sorted by ``Entries._key``: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/columns_name_window_sort_keys.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --columns[n_likes_cumulative_sum_per_tag].stage initial \ +.. --columns[n_likes_cumulative_sum_per_tag].type UInt32 \ +.. --columns[n_likes_cumulative_sum_per_tag].value 'window_sum(n_likes)' \ +.. --columns[n_likes_cumulative_sum_per_tag].window.sort_keys _key \ +.. --columns[n_likes_cumulative_sum_per_tag].window.group_keys tag \ +.. --filter 'n_likes_cumulative_sum_per_tag > 5' + +.. _logical-count-columns-name-window-group-keys: + +``columns[${NAME}].window.group_keys`` +"""""""""""""""""""""""""""""""""""""" + +.. versionadded:: 7.0.9 + +Corresponds to :ref:`select-columns-name-window-group-keys` in +:doc:`select`. See :ref:`select-columns-name-window-group-keys` for +details. + +You must specify :ref:`logical-count-columns-name-window-sort-keys` +or :ref:`logical-count-columns-name-window-group-keys` to use window +function. + +Here is an example that computes sum per ``Entries.tag``: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/columns_name_window_group_keys.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --columns[n_likes_sum_per_tag].stage initial \ +.. --columns[n_likes_sum_per_tag].type UInt32 \ +.. --columns[n_likes_sum_per_tag].value 'window_sum(n_likes)' \ +.. --columns[n_likes_sum_per_tag].window.group_keys tag \ +.. --filter 'n_likes_sum_per_tag > 5' + +Cache related parameter +^^^^^^^^^^^^^^^^^^^^^^^ + +.. _logical-count-cache: + +``cache`` +""""""""" + +Specifies whether caching the result of this query or not. + +If the result of this query is cached, the next same query returns +response quickly by using the cache. + +It doesn't control whether existing cached result is used or not. + +Here are available values: + +.. list-table:: + :header-rows: 1 + + * - Value + - Description + * - ``no`` + - Don't cache the output of this query. + * - ``yes`` + - Cache the output of this query. + It's the default value. + +Here is an example to disable caching the result of this query: + +.. groonga-command +.. include:: ../../example/reference/commands/logical_count/cache_no.log +.. logical_count \ +.. --logical_table Entries \ +.. --shard_key created_at \ +.. --cache no + +The default value is ``yes``. Return value ------------ -TODO +The command returns a response with the following format:: + + [HEADER, N_HITS] + +If the command fails, error details are in ``HEADER``. -:: +See :doc:`/reference/command/output_format` for ``HEADER``. - [HEADER, LOGICAL_COUNT] +``N_HITS`` is the number of matched records. Modified: doc/source/reference/commands/logical_range_filter.rst (+12 -6) =================================================================== --- doc/source/reference/commands/logical_range_filter.rst 2017-11-07 16:15:51 +0900 (a886bee05) +++ doc/source/reference/commands/logical_range_filter.rst 2017-11-07 16:48:30 +0900 (3577fe876) @@ -52,14 +52,14 @@ The required parameters are ``logical_table`` and ``shard_key``:: logical_table shard_key [min=null] - [min_border=null] + [min_border="include"] [max=null] - [max_border=null] - [order=ascending] + [max_border="include"] + [order="ascending"] [filter=null] [offset=0] [limit=10] - [output_columns=_key,*] + [output_columns="_key, *"] [use_range_index=null] There are some parameters that can be only used as named @@ -271,6 +271,14 @@ TODO: Add examples TODO +.. _logical-range-filter-search-related-parameters: + +Search related parameters +^^^^^^^^^^^^^^^^^^^^^^^^^ + +This command provides :doc:`select` compatible search related +parameters. + ``filter`` """""""""" @@ -524,7 +532,6 @@ Here is an example that computes cumulative sum per .. --columns[n_likes_cumulative_sum_per_tag].value 'window_sum(n_likes)' \ .. --columns[n_likes_cumulative_sum_per_tag].window.sort_keys _key \ .. --columns[n_likes_cumulative_sum_per_tag].window.group_keys tag \ -.. --sort_keys _key \ .. --output_columns tag,_key,n_likes,n_likes_cumulative_sum_per_tag .. _logical-range-filter-columns-name-window-group-keys: @@ -553,7 +560,6 @@ Here is an example that computes sum per ``Entries.tag``: .. --columns[n_likes_sum_per_tag].type UInt32 \ .. --columns[n_likes_sum_per_tag].value 'window_sum(n_likes)' \ .. --columns[n_likes_sum_per_tag].window.group_keys tag \ -.. --sort_keys _key \ .. --output_columns tag,_key,n_likes,n_likes_sum_per_tag Cache related parameter Modified: doc/source/reference/commands/logical_select.rst (+1 -1) =================================================================== --- doc/source/reference/commands/logical_select.rst 2017-11-07 16:15:51 +0900 (1eaf447ed) +++ doc/source/reference/commands/logical_select.rst 2017-11-07 16:48:30 +0900 (c66e1e08a) @@ -423,7 +423,7 @@ Here is an example for ``exclude``. The result doesn't include the Search related parameters ^^^^^^^^^^^^^^^^^^^^^^^^^ -``logical_select`` provides :doc:`select` compatible search related +This command provides :doc:`select` compatible search related parameters. .. _logical-select-match-columns: