Navigation Menu

Skip to content

Commit

Permalink
doc logical_select: add document for post_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
komainu8 committed Feb 19, 2018
1 parent 363414c commit 75a1d8f
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 9 deletions.
33 changes: 24 additions & 9 deletions doc/locale/ja/LC_MESSAGES/reference.po
Expand Up @@ -223,6 +223,12 @@ msgstr ""
"Groongaを全文検索ライブラリとして使うことができます。この節ではGroongaが提供"
"しているAPIを示します。"

msgid "パラメータ"
msgstr ""

msgid "戻り値"
msgstr ""

msgid "Global configurations"
msgstr "全体設定"

Expand Down Expand Up @@ -4478,12 +4484,6 @@ msgstr ""
"``HEADER`` については :doc:`/reference/command/output_format` を参照してくだ"
"さい。"

msgid ""
"The number of kinds of index target data and the number of handleable "
"records in a small index column"
msgstr ""
"インデックス対象データの種類数と小さなインデックスカラムで扱えるレコード数"

msgid "``column_create``"
msgstr ""

Expand Down Expand Up @@ -5023,6 +5023,12 @@ msgstr ""
"``2`` と ``3`` )になります。以下の表はインデックス対象データの種類数と扱える"
"最大レコード数の関係を示しています。"

msgid ""
"The number of kinds of index target data and the number of handleable "
"records in a small index column"
msgstr ""
"インデックス対象データの種類数と小さなインデックスカラムで扱えるレコード数"

msgid "The number of kinds of index target data"
msgstr "インデックス対象のデータの種類数"

Expand Down Expand Up @@ -8198,6 +8204,15 @@ msgstr ""
msgid "See also :ref:`logical-select-match-columns`."
msgstr ":ref:`logical-select-match-columns` も参照してください。"

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:`logical-select-filter`."
msgstr ""
"``filtered`` ステージの動的カラムが生成されてから実行するフィルターを指定しま"
"す。 ``post_filter`` を使うと ``filtered`` ステージの動的カラムを使って絞り込"
"むことができます。他は :ref:`logical-select-filter` と同じです。"

msgid "Advanced search parameters"
msgstr "高度な検索のための引数"

Expand Down Expand Up @@ -25817,9 +25832,6 @@ msgid ""
"records are fetched."
msgstr ""

msgid "Characteristics of all tables"
msgstr "全テーブルの特徴"

msgid "Tables"
msgstr "テーブル"

Expand Down Expand Up @@ -25853,6 +25865,9 @@ msgstr ""
"以下はGroongaにあるすべてのテーブルの特性表です。(この表の中では ``TABLE_`` "
"プレフィックスは省略しています。)"

msgid "Characteristics of all tables"
msgstr "全テーブルの特徴"

msgid "Item"
msgstr ""

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

logical_select \
--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,
# 1519030779.410312,
# 0.04758048057556152
# ],
# [
# [
# [
# 2
# ],
# [
# [
# "_key",
# "ShortText"
# ],
# [
# "n_likes",
# "UInt32"
# ],
# [
# "n_likes_sum_per_tag",
# "UInt32"
# ]
# ]
# [
# "Groonga",
# 10,
# 25
# ],
# [
# "Mroonga",
# 15,
# 25
# ]
# ]
# ]
# ]
27 changes: 27 additions & 0 deletions doc/source/reference/commands/logical_select.rst
Expand Up @@ -51,6 +51,7 @@ parameters are optional::
[match_columns=null]
[query=null]
[drilldown_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 @@ -488,6 +489,32 @@ Here is an example:
.. _logical-select-advanced-search-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:`logical-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_select/post_filter.log
.. logical_select \
.. --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
Advanced search parameters
^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 75a1d8f

Please sign in to comment.