Navigation Menu

Skip to content

Commit

Permalink
doc logical_count: add document for post_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
komainu8 committed Feb 20, 2018
1 parent 75a1d8f commit e672b14
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 16 deletions.
39 changes: 25 additions & 14 deletions doc/locale/ja/LC_MESSAGES/reference.po
Expand Up @@ -7402,6 +7402,25 @@ msgstr ""
":doc:`select` の :ref:`select-filter` に対応しています。詳細は :ref:`select-"
"filter` を見てください。"

msgid "``post_filter``"
msgstr ""

msgid ""
"Specifies the filter text that is processed after ``filtered`` stage dynamic "
"columns are generated. You can use ``post_filter`` to filter by ``filtered`` "
"stage dynamic columns. Others are the same as :ref:`select-filter`."
msgstr ""
"``filtered`` ステージの動的カラムが生成されてから実行するフィルターを指定しま"
"す。 ``post_filter`` を使うと ``filtered`` ステージの動的カラムを使って絞り込"
"むことができます。他は :ref:`select-filter` と同じです。"

msgid ""
"Here is an example that shows entries only in popular tag. All target "
"entries have ``system`` or ``use`` words:"
msgstr ""
"以下は人気のあるタグのエントリーだけを表示する例です。対象となるすべてのエン"
"トリーには ``system`` または ``use`` という単語が含まれています。"

msgid "Dynamic column related parameters"
msgstr "動的カラム関連の引数"

Expand All @@ -7426,11 +7445,13 @@ msgid "This is a required parameter."
msgstr "必須の引数です。"

msgid ""
"Only ``initial`` stage is valid. Because there are no processes after "
"``filtered`` and ``output`` stages."
"``initial`` stage and ``filtered`` stage are valid. Because there are no "
"processes after ``output`` stages. But ``filtered`` stage is valid in "
"groonga since version 8.0.1."
msgstr ""
"``initial`` ステージだけが有効です。なぜなら ``filtered`` ステージと "
"``output`` ステージ以降にはなにも処理がないからです。"
"``initial`` ステージと ``filtered`` ステージが有効です。なぜなら ``output`` "
"ステージ以降にはなにも処理がないからです。ただし、``filtered`` ステージはバー"
"ジョン8.0.0以降で有効です。"

msgid ""
"Here is an example that creates ``is_popular`` column at ``initial`` stage. "
Expand Down Expand Up @@ -7815,9 +7836,6 @@ msgstr ""
msgid "``order``"
msgstr ""

msgid "``post_filter``"
msgstr ""

msgid ""
"Specifies the filter text that is processed after ``filtered`` stage dynamic "
"columns are generated. You can use ``post_filter`` to filter by ``filtered`` "
Expand All @@ -7841,13 +7859,6 @@ msgstr ""
"ムが生成されるのを待つ必要があるからです。 :ref:`logical-range-filter-"
"dynamic-column-related-parameters` も参照してください。"

msgid ""
"Here is an example that shows entries only in popular tag. All target "
"entries have ``system`` or ``use`` words:"
msgstr ""
"以下は人気のあるタグのエントリーだけを表示する例です。対象となるすべてのエン"
"トリーには ``system`` または ``use`` という単語が含まれています。"

msgid "Output related parameters"
msgstr "出力関連の引数"

Expand Down
@@ -0,0 +1,13 @@
Execution example::

logical_count \
--logical_table Entries \
--shard_key created_at \
--columns[n_likes_sum_per_tag].stage filtered \
--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 'content @ "system" || content @ "use"' \
--post_filter 'n_likes_sum_per_tag > 10' \
--output_columns _key,n_likes,n_likes_sum_per_tag
# [[0,1519095081.579662,0.4281206130981445],2]
31 changes: 29 additions & 2 deletions doc/source/reference/commands/logical_count.rst
Expand Up @@ -45,6 +45,7 @@ parameters are optional::
[max=null]
[max_border="include"]
[filter=null]
[post_filter=null]

There are some parameters that can be only used as named
parameters. You can't use these parameters as ordered parameters. You
Expand Down Expand Up @@ -393,6 +394,31 @@ Here is an example:
.. _logical-count-dynamic-column-related-parameters:

``post_filter``
"""""""""""""""

.. versionadded:: 8.0.1

Specifies the filter text that is processed after ``filtered`` stage
dynamic columns are generated. You can use ``post_filter`` to filter
by ``filtered`` stage dynamic columns. Others are the same as
:ref:`select-filter`.

Here is an example that shows entries only in popular tag. All target
entries have ``system`` or ``use`` words:

.. groonga-command
.. include:: ../../example/reference/commands/logical_count/post_filter.log
.. logical_cout \
.. --logical_table Entries \
.. --shard_key created_at \
.. --columns[n_likes_sum_per_tag].stage filtered \
.. --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 'content @ "system" || content @ "use"' \
.. --post_filter 'n_likes_sum_per_tag > 10' \
Dynamic column related parameters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -414,8 +440,9 @@ Corresponds to :ref:`select-columns-name-stage` in :doc:`select`. See

This is a required parameter.

Only ``initial`` stage is valid. Because there are no processes after
``filtered`` and ``output`` stages.
``initial`` stage and ``filtered`` stage are valid. Because there are no processes after
``output`` stages.
But ``filtered`` stage is valid in groonga since version 8.0.1.

Here is an example that creates ``is_popular`` column at ``initial``
stage. You can use ``is_popular`` in all parameters such as ``filter``:
Expand Down

0 comments on commit e672b14

Please sign in to comment.