[Groonga-commit] groonga/groonga at 22f6738 [master] logical_range_filter: document sort_keys

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Apr 11 13:55:31 JST 2018


Kouhei Sutou	2018-04-11 13:55:31 +0900 (Wed, 11 Apr 2018)

  New Revision: 22f6738bdcab8896e1095937b96498708bda69bb
  https://github.com/groonga/groonga/commit/22f6738bdcab8896e1095937b96498708bda69bb

  Message:
    logical_range_filter: document sort_keys

  Added files:
    doc/source/example/reference/commands/logical_range_filter/sort_keys_on_shared_key.log
    doc/source/example/reference/commands/logical_range_filter/sort_keys_one.log
  Modified files:
    doc/locale/ja/LC_MESSAGES/reference.po
    doc/source/reference/commands/logical_range_filter.rst
    doc/source/reference/commands/logical_select.rst

  Modified: doc/locale/ja/LC_MESSAGES/reference.po (+40 -36)
===================================================================
--- doc/locale/ja/LC_MESSAGES/reference.po    2018-04-10 23:55:35 +0900 (fcaeedd85)
+++ doc/locale/ja/LC_MESSAGES/reference.po    2018-04-11 13:55:31 +0900 (622ad447d)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 1.2.1\n"
 "Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2018-03-08 17:07+0900\n"
+"PO-Revision-Date: 2018-04-11 13:55+0900\n"
 "Last-Translator: Masafumi Yokoyama <yokoyama �� clear-code.com>\n"
 "Language-Team: Japanese\n"
 "Language: ja\n"
@@ -7879,6 +7879,45 @@ msgstr ""
 ":doc:`select` の :ref:`select-output-columns` に対応しています。詳細は :ref:"
 "`select-output-columns` を見てください。"
 
+msgid "``sort_keys``"
+msgstr ""
+
+msgid ""
+"Corresponds to :ref:`select-sort-keys` in :doc:`select`. See :ref:`select-"
+"sort-keys` for details."
+msgstr ""
+":doc:`select` の :ref:`select-sort-keys` に対応しています。詳細は :ref:"
+"`select-sort-keys` を見てください。"
+
+msgid ""
+"``sort_keys`` has a limitation. It works only when the number of search "
+"target shards is one. If the number of search target shards is larger than "
+"one, ``sort_keys`` doesn't work."
+msgstr ""
+"``sort_keys`` には制限があります。検索対象のシャードが1つの場合のみ動作しま"
+"す。もし、検索対象のシャードが複数ある場合、 ``sort_keys`` は正常な動作をしま"
+"せん。"
+
+msgid ""
+"There is one exception for multiple shards. When the same value is specified "
+"for ``shard_key`` and ``sort_keys``, they are supported. This command "
+"processes target shards one by one by ascending order. Thus, in this "
+"process, magnitude correlation about the value of ``shard_key`` is kept "
+"among them. This is because ``sort_keys`` is supported when ``shard_key`` "
+"and ``sort_keys`` is same."
+msgstr ""
+"複数のシャードに関して例外があります。``shard_key`` と ``sort_keys`` に同じ値"
+"が指定された場合です。その場合はサポートしています。このコマンドはシャードを"
+"昇順で順番に処理します。そのため、``shard_key`` の大小関係は保たれるので、正"
+"しくソートできます。"
+
+msgid "Here is an example that uses only one shard:"
+msgstr "以下は1つのシャードのみを使っている例です。"
+
+msgid ""
+"Here is an example that uses ``shard_key`` based value as the first sort key:"
+msgstr "以下は ``shard_key`` ベースの値を第一ソートキーに指定している例です。"
+
 msgid ""
 "Corresponds to :ref:`select-offset` in :doc:`select`. See :ref:`select-"
 "offset` for details."
@@ -8246,41 +8285,6 @@ msgstr ""
 msgid "Use :ref:`logical-select-sort-keys` instead."
 msgstr "代わりに :ref:`logical-select-sort-keys` を使ってください。"
 
-msgid "``sort_keys``"
-msgstr ""
-
-msgid ""
-"Corresponds to :ref:`select-sort-keys` in :doc:`select`. See :ref:`select-"
-"sort-keys` for details."
-msgstr ""
-":doc:`select` の :ref:`select-sort-keys` に対応しています。詳細は :ref:"
-"`select-sort-keys` を見てください。"
-
-msgid ""
-"``sort_keys`` has a limitation. It works only when the number of search "
-"target shards is one. If the number of search target shards is larger than "
-"one, ``sort_keys`` doesn't work."
-msgstr ""
-"``sort_keys`` には制限があります。検索対象のシャードが1つの場合のみ動作しま"
-"す。もし、検索対象のシャードが複数ある場合、 ``sort_keys`` は正常な動作をしま"
-"せん。"
-
-msgid ""
-"There is one exception for multiple shards. When the same value is specified "
-"for ``shard_key`` and ``sort_keys``, they are supported. ``logical_select`` "
-"processes target shards one by one by ascending order. Thus, in this "
-"process, magnitude correlation about the value of ``shard_key`` is kept "
-"among them. This is because ``sort_keys`` is supported when ``shard_key`` "
-"and ``sort_keys`` is same."
-msgstr ""
-"複数のシャードに関して例外があります。``shard_key`` と ``sort_keys`` に同じ値"
-"が指定された場合です。その場合はサポートしています。``logical_select`` は"
-"シャードを昇順で順番に処理します。そのため、``shard_key`` の大小関係は保たれ"
-"るので、正しくソートできます。"
-
-msgid "Here is an example that uses only one shard:"
-msgstr "以下は1つのシャードのみを使っている例です。"
-
 msgid ""
 "You need to specify :doc:`/reference/window_function` as ``value`` value and "
 "other window function related parameters when you use window function. See :"

  Added: doc/source/example/reference/commands/logical_range_filter/sort_keys_on_shared_key.log (+66 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/logical_range_filter/sort_keys_on_shared_key.log    2018-04-11 13:55:31 +0900 (204727848)
@@ -0,0 +1,66 @@
+Execution example::
+
+  plugin_register functions/time
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  logical_select \
+    --logical_table Entries \
+    --shard_key created_at \
+    --columns[hour2].stage filtered \
+    --columns[hour2].type Time \
+    --columns[hour2].flags COLUMN_SCALAR \
+    --columns[hour2].value 'time_classify_hour(created_at, 2)' \
+    --sort_keys hour2,-n_likes \
+    --output_columns hour2,n_likes,_key
+  # [
+  #   [
+  #     0, 
+  #     1337566253.89858, 
+  #     0.000355720520019531
+  #   ], 
+  #   [
+  #     [
+  #       [
+  #         5
+  #       ], 
+  #       [
+  #         [
+  #           "hour2", 
+  #           "Time"
+  #         ], 
+  #         [
+  #           "n_likes", 
+  #           "UInt32"
+  #         ], 
+  #         [
+  #           "_key", 
+  #           "ShortText"
+  #         ]
+  #       ], 
+  #       [
+  #         1436367600.0, 
+  #         3, 
+  #         "Good-bye Senna"
+  #       ], 
+  #       [
+  #         1436367600.0, 
+  #         3, 
+  #         "Good-bye Tritonn"
+  #       ], 
+  #       [
+  #         1436281200.0, 
+  #         10, 
+  #         "Groonga"
+  #       ], 
+  #       [
+  #         1436281200.0, 
+  #         5, 
+  #         "The first post!"
+  #       ], 
+  #       [
+  #         1436288400.0, 
+  #         15, 
+  #         "Mroonga"
+  #       ]
+  #     ]
+  #   ]
+  # ]

  Added: doc/source/example/reference/commands/logical_range_filter/sort_keys_one.log (+51 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/logical_range_filter/sort_keys_one.log    2018-04-11 13:55:31 +0900 (e9dfbc15f)
@@ -0,0 +1,51 @@
+Execution example::
+
+  logical_select \
+    --logical_table Entries \
+    --shard_key created_at \
+    --sort_keys _key \
+    --output_columns _key,created_at
+  # [
+  #   [
+  #     0, 
+  #     1337566253.89858, 
+  #     0.000355720520019531
+  #   ], 
+  #   [
+  #     [
+  #       [
+  #         5
+  #       ], 
+  #       [
+  #         [
+  #           "_key", 
+  #           "ShortText"
+  #         ], 
+  #         [
+  #           "created_at", 
+  #           "Time"
+  #         ]
+  #       ], 
+  #       [
+  #         "Groonga", 
+  #         1436284800.0
+  #       ], 
+  #       [
+  #         "Mroonga", 
+  #         1436288400.0
+  #       ], 
+  #       [
+  #         "The first post!", 
+  #         1436281200.0
+  #       ], 
+  #       [
+  #         "Good-bye Senna", 
+  #         1436367600.0
+  #       ], 
+  #       [
+  #         "Good-bye Tritonn", 
+  #         1436371200.0
+  #       ]
+  #     ]
+  #   ]
+  # ]

  Modified: doc/source/reference/commands/logical_range_filter.rst (+50 -0)
===================================================================
--- doc/source/reference/commands/logical_range_filter.rst    2018-04-10 23:55:35 +0900 (533693bfa)
+++ doc/source/reference/commands/logical_range_filter.rst    2018-04-11 13:55:31 +0900 (15d42095a)
@@ -62,6 +62,7 @@ The required parameters are ``logical_table`` and ``shard_key``::
     [output_columns="_key, *"]
     [use_range_index=null]
     [post_filter=null]
+    [sort_keys=null]
 
 There are some parameters that can be only used as named
 parameters. You can't use these parameters as ordered parameters. You
@@ -354,6 +355,55 @@ Here is an example:
 ..   --shard_key created_at \
 ..   --output_columns '_key, *'
 
+.. _logical-range-filter-sort-keys:
+
+``sort_keys``
+"""""""""""""
+
+.. versionadded:: 8.0.2
+
+Corresponds to :ref:`select-sort-keys` in :doc:`select`. See
+:ref:`select-sort-keys` for details.
+
+``sort_keys`` has a limitation. It works only when the number of
+search target shards is one. If the number of search target shards is
+larger than one, ``sort_keys`` doesn't work.
+
+.. note::
+
+   There is one exception for multiple shards. When the same value is
+   specified for ``shard_key`` and ``sort_keys``, they are supported.
+   This command processes target shards one by one by ascending
+   order. Thus, in this process, magnitude correlation about the value
+   of ``shard_key`` is kept among them. This is because ``sort_keys``
+   is supported when ``shard_key`` and ``sort_keys`` is same.
+
+Here is an example that uses only one shard:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/logical_range_filter/sort_keys_one.log
+.. logical_select \
+..   --logical_table Entries \
+..   --shard_key created_at \
+..   --sort_keys _key \
+..   --output_columns _key,created_at
+
+Here is an example that uses ``shard_key`` based value as the first
+sort key:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/logical_range_filter/sort_keys_on_shared_key.log
+.. plugin_register functions/time
+.. logical_select \
+..   --logical_table Entries \
+..   --shard_key created_at \
+..   --columns[hour2].stage filtered \
+..   --columns[hour2].type Time \
+..   --columns[hour2].flags COLUMN_SCALAR \
+..   --columns[hour2].value 'time_classify_hour(created_at, 2)' \
+..   --sort_keys hour2,-n_likes \
+..   --output_columns hour2,n_likes,_key
+
 .. _logical-range-filter-offset:
 
 ``offset``

  Modified: doc/source/reference/commands/logical_select.rst (+1 -1)
===================================================================
--- doc/source/reference/commands/logical_select.rst    2018-04-10 23:55:35 +0900 (8908e6be3)
+++ doc/source/reference/commands/logical_select.rst    2018-04-11 13:55:31 +0900 (ed98fd8d5)
@@ -588,7 +588,7 @@ larger than one, ``sort_keys`` doesn't work.
 
    There is one exception for multiple shards. When the same value is
    specified for ``shard_key`` and ``sort_keys``, they are supported.
-   ``logical_select`` processes target shards one by one by ascending
+   This command processes target shards one by one by ascending
    order. Thus, in this process, magnitude correlation about the value
    of ``shard_key`` is kept among them. This is because ``sort_keys``
    is supported when ``shard_key`` and ``sort_keys`` is same.
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180411/70f6b49e/attachment-0001.htm 



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