| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
.. groonga-command |
| 4 |
.. database: commands_logical_parameters |
| 5 |
|
| 6 |
``logical_parameters`` |
| 7 |
====================== |
| 8 |
|
| 9 |
Summary |
| 10 |
------- |
| 11 |
|
| 12 |
.. versionadded:: 5.0.6 |
| 13 |
|
| 14 |
``logical_parameters`` is a command for test. Normally, you don't need |
| 15 |
to use this command. |
| 16 |
|
| 17 |
``logical_parameters`` provides the following two features: |
| 18 |
|
| 19 |
* It returns the current parameters for ``logical_*`` commands. |
| 20 |
* It sets new parameters for ``logical_*`` commands. |
| 21 |
|
| 22 |
Here is a list of parameters: |
| 23 |
|
| 24 |
* :ref:`logical-parameters-range-index` |
| 25 |
|
| 26 |
.. note:: |
| 27 |
|
| 28 |
The parameters are independent in each thread. (To be exact, each |
| 29 |
:c:type:`grn_ctx`.) If you want to control the parameters |
| 30 |
perfectly, you should reduce the max number of threads to ``1`` by |
| 31 |
:doc:`/reference/commands/thread_limit` while you're using the |
| 32 |
parameters. |
| 33 |
|
| 34 |
Syntax |
| 35 |
------ |
| 36 |
|
| 37 |
This command takes only one optional parameter:: |
| 38 |
|
| 39 |
logical_parameters [range_index=null] |
| 40 |
|
| 41 |
Usage |
| 42 |
----- |
| 43 |
|
| 44 |
You need to register ``sharding`` plugin to use this command: |
| 45 |
|
| 46 |
.. groonga-command |
| 47 |
.. include:: ../../example/reference/commands/logical_parameters/usage_register.log |
| 48 |
.. plugin_register sharding |
| 49 |
|
| 50 |
You can get the all current parameter values by calling without |
| 51 |
parameters: |
| 52 |
|
| 53 |
.. groonga-command |
| 54 |
.. include:: ../../example/reference/commands/logical_parameters/usage_get.log |
| 55 |
.. logical_parameters |
| 56 |
|
| 57 |
You can set new values by calling with parameters: |
| 58 |
|
| 59 |
.. groonga-command |
| 60 |
.. include:: ../../example/reference/commands/logical_parameters/usage_set.log |
| 61 |
.. logical_parameters --range_index never |
| 62 |
|
| 63 |
``logical_parameters`` returns the parameter values before new values |
| 64 |
are set when you set new values. |
| 65 |
|
| 66 |
Parameters |
| 67 |
---------- |
| 68 |
|
| 69 |
This section describes parameters. |
| 70 |
|
| 71 |
Required parameters |
| 72 |
^^^^^^^^^^^^^^^^^^^ |
| 73 |
|
| 74 |
There is no required parameter. |
| 75 |
|
| 76 |
Optional parameters |
| 77 |
^^^^^^^^^^^^^^^^^^^ |
| 78 |
|
| 79 |
There is one optional parameter. |
| 80 |
|
| 81 |
.. _logical-parameters-range-index: |
| 82 |
|
| 83 |
``range_index`` |
| 84 |
""""""""""""""" |
| 85 |
|
| 86 |
Specifies how to use range index in :doc:`logical_range_filter` by |
| 87 |
keyword. |
| 88 |
|
| 89 |
Here are available keywords: |
| 90 |
|
| 91 |
* ``auto`` (default) |
| 92 |
* ``always`` |
| 93 |
* ``never`` |
| 94 |
|
| 95 |
If ``auto`` is specified, range index is used only when it'll be |
| 96 |
efficient. This is the default value. |
| 97 |
|
| 98 |
.. groonga-command |
| 99 |
.. include:: ../../example/reference/commands/logical_parameters/range_index_auto.log |
| 100 |
.. logical_parameters --range_index auto |
| 101 |
|
| 102 |
If ``always`` is specified, range index is always used. It'll be |
| 103 |
useful for testing a case that range index is used. |
| 104 |
|
| 105 |
.. groonga-command |
| 106 |
.. include:: ../../example/reference/commands/logical_parameters/range_index_always.log |
| 107 |
.. logical_parameters --range_index always |
| 108 |
|
| 109 |
If ``never`` is specified, range index is never used. It'll be useful |
| 110 |
for testing a case that range index isn't used. |
| 111 |
|
| 112 |
.. groonga-command |
| 113 |
.. include:: ../../example/reference/commands/logical_parameters/range_index_never.log |
| 114 |
.. logical_parameters --range_index never |
| 115 |
|
| 116 |
Return value |
| 117 |
------------ |
| 118 |
|
| 119 |
The command returns the current parameters for ``logical_*`` command:: |
| 120 |
|
| 121 |
[ |
| 122 |
HEADER, |
| 123 |
{"range_index": HOW_TO_USE_RANGE_INDEX} |
| 124 |
] |
| 125 |
|
| 126 |
``HOW_TO_USE_RANGE_INDEX`` value is one of the followings: |
| 127 |
|
| 128 |
* ``"auto"`` |
| 129 |
* ``"always"`` |
| 130 |
* ``"never"`` |
| 131 |
|
| 132 |
See :doc:`/reference/command/output_format` for ``HEADER``. |