[Groonga-commit] groonga/groonga at 4caab32 [master] doc logical_select: add "cache" document

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Nov 6 16:22:39 JST 2017


Kouhei Sutou	2017-11-06 16:22:39 +0900 (Mon, 06 Nov 2017)

  New Revision: 4caab32329015941c88490693c5012c7a38ae047
  https://github.com/groonga/groonga/commit/4caab32329015941c88490693c5012c7a38ae047

  Message:
    doc logical_select: add "cache" document

  Added files:
    doc/source/example/reference/commands/logical_select/cache_no.log
  Modified files:
    doc/source/example/reference/commands/logical_select/logical_table_nonexistent.log
    doc/source/reference/commands/logical_select.rst

  Added: doc/source/example/reference/commands/logical_select/cache_no.log (+86 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/logical_select/cache_no.log    2017-11-06 16:22:39 +0900 (a8da96549)
@@ -0,0 +1,86 @@
+Execution example::
+
+  logical_select \
+    --logical_table Entries \
+    --shard_key created_at \
+    --cache no
+  # [
+  #   [
+  #     0, 
+  #     1337566253.89858, 
+  #     0.000355720520019531
+  #   ], 
+  #   [
+  #     [
+  #       [
+  #         5
+  #       ], 
+  #       [
+  #         [
+  #           "_id", 
+  #           "UInt32"
+  #         ], 
+  #         [
+  #           "_key", 
+  #           "ShortText"
+  #         ], 
+  #         [
+  #           "content", 
+  #           "Text"
+  #         ], 
+  #         [
+  #           "created_at", 
+  #           "Time"
+  #         ], 
+  #         [
+  #           "n_likes", 
+  #           "UInt32"
+  #         ], 
+  #         [
+  #           "tag", 
+  #           "ShortText"
+  #         ]
+  #       ], 
+  #       [
+  #         1, 
+  #         "The first post!", 
+  #         "Welcome! This is my first post!", 
+  #         1436281200.0, 
+  #         5, 
+  #         "Hello"
+  #       ], 
+  #       [
+  #         2, 
+  #         "Groonga", 
+  #         "I started to use Groonga. It's very fast!", 
+  #         1436284800.0, 
+  #         10, 
+  #         "Groonga"
+  #       ], 
+  #       [
+  #         3, 
+  #         "Mroonga", 
+  #         "I also started to use Mroonga. It's also very fast! Really fast!", 
+  #         1436288400.0, 
+  #         15, 
+  #         "Groonga"
+  #       ], 
+  #       [
+  #         1, 
+  #         "Good-bye Senna", 
+  #         "I migrated all Senna system!", 
+  #         1436367600.0, 
+  #         3, 
+  #         "Senna"
+  #       ], 
+  #       [
+  #         2, 
+  #         "Good-bye Tritonn", 
+  #         "I also migrated all Tritonn system!", 
+  #         1436371200.0, 
+  #         3, 
+  #         "Senna"
+  #       ]
+  #     ]
+  #   ]
+  # ]

  Modified: doc/source/example/reference/commands/logical_select/logical_table_nonexistent.log (+1 -1)
===================================================================
--- doc/source/example/reference/commands/logical_select/logical_table_nonexistent.log    2017-11-06 16:01:00 +0900 (10e07d504)
+++ doc/source/example/reference/commands/logical_select/logical_table_nonexistent.log    2017-11-06 16:22:39 +0900 (b6c2a339e)
@@ -11,7 +11,7 @@ Execution example::
   #       [
   #         "Groonga::Sharding::LogicalSelectCommand::Executor.execute_search", 
   #         "/home/kou/work/c/groonga.clean/plugins/sharding/logical_select.rb", 
-  #         728
+  #         548
   #       ]
   #     ]
   #   ]

  Modified: doc/source/reference/commands/logical_select.rst (+51 -5)
===================================================================
--- doc/source/reference/commands/logical_select.rst    2017-11-06 16:01:00 +0900 (f400dc6a3)
+++ doc/source/reference/commands/logical_select.rst    2017-11-06 16:22:39 +0900 (c19085e4c)
@@ -18,7 +18,7 @@ Summary
 tables and outputs them.
 
 You need to :doc:`plugin_register` ``sharding`` plugin because
-``logical_select`` is included in ``sharding`` plugin.
+this command is included in ``sharding`` plugin.
 
 Syntax
 ------
@@ -52,6 +52,14 @@ parameters are optional::
                  [query=null]
                  [drilldown_filter=null]
 
+There are some parameters that can be only used as named
+parameters. You can't use these parameters as ordered parameters. You
+must specify parameter name.
+
+Here are parameters that can be only used as named parameters:
+
+  * ``cache=no``
+
 This command has the following named parameters for dynamic columns:
 
    * ``columns[${NAME}].stage=null``
@@ -147,7 +155,6 @@ But there are some differences from :doc:`select`:
     doesn't work with multiple shards. It works with one
     shard. ``_key`` in ``drilldowns[${LABEL}].sort_keys`` work with
     multiple shards.
-  * ``cache`` isn't supported yet.
   * ``match_escalation_threshold`` isn't supported yet.
   * ``query_flags`` isn't supported yet.
   * ``query_expander`` isn't supported yet.
@@ -156,10 +163,10 @@ But there are some differences from :doc:`select`:
 Usage
 -----
 
-Let's learn about ``logical_select`` usage with examples. This section
-shows many popular usages.
+Let's learn about usage with examples. This section shows many popular
+usages.
 
-You need to register ``sharding`` plugin because ``logical_select`` is
+You need to register ``sharding`` plugin because this command is
 included in ``sharding`` plugin.
 
 .. groonga-command
@@ -1364,6 +1371,45 @@ for each the same number of sub records:
 ..   --drilldowns[tag].sort_keys _nsubrecs,record_number \
 ..   --drilldowns[tag].output_columns _key,_nsubrecs,record_number
 
+Cache related parameter
+^^^^^^^^^^^^^^^^^^^^^^^
+
+.. _logical-select-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_select/cache_no.log
+.. logical_select \
+..   --logical_table Entries \
+..   --shard_key created_at \
+..   --cache no
+
+The default value is ``yes``.
+
 Return value
 ------------
 
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171106/35a1fec2/attachment-0001.htm 



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