File: logical_parameters.rst

package info (click to toggle)
groonga 15.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 163,080 kB
  • sloc: ansic: 770,564; cpp: 48,925; ruby: 40,447; javascript: 10,250; yacc: 7,045; sh: 5,602; python: 2,821; makefile: 1,672
file content (132 lines) | stat: -rw-r--r-- 3,177 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.. -*- rst -*-

.. groonga-command
.. database: commands_logical_parameters

``logical_parameters``
======================

Summary
-------

.. versionadded:: 5.0.6

``logical_parameters`` is a command for test. Normally, you don't need
to use this command.

``logical_parameters`` provides the following two features:

  * It returns the current parameters for ``logical_*`` commands.
  * It sets new parameters for ``logical_*`` commands.

Here is a list of parameters:

  * :ref:`logical-parameters-range-index`

.. note::

   The parameters are independent in each thread. (To be exact, each
   :c:type:`grn_ctx`.) If you want to control the parameters
   perfectly, you should reduce the max number of threads to ``1`` by
   :doc:`/reference/commands/thread_limit` while you're using the
   parameters.

Syntax
------

This command takes only one optional parameter::

  logical_parameters [range_index=null]

Usage
-----

You need to register ``sharding`` plugin to use this command:

.. groonga-command
.. include:: ../../example/reference/commands/logical_parameters/usage_register.log
.. plugin_register sharding

You can get the all current parameter values by calling without
parameters:

.. groonga-command
.. include:: ../../example/reference/commands/logical_parameters/usage_get.log
.. logical_parameters

You can set new values by calling with parameters:

.. groonga-command
.. include:: ../../example/reference/commands/logical_parameters/usage_set.log
.. logical_parameters --range_index never

``logical_parameters`` returns the parameter values before new values
are set when you set new values.

Parameters
----------

This section describes parameters.

Required parameters
^^^^^^^^^^^^^^^^^^^

There is no required parameter.

Optional parameters
^^^^^^^^^^^^^^^^^^^

There is one optional parameter.

.. _logical-parameters-range-index:

``range_index``
"""""""""""""""

Specifies how to use range index in :doc:`logical_range_filter` by
keyword.

Here are available keywords:

  * ``auto`` (default)
  * ``always``
  * ``never``

If ``auto`` is specified, range index is used only when it'll be
efficient. This is the default value.

.. groonga-command
.. include:: ../../example/reference/commands/logical_parameters/range_index_auto.log
.. logical_parameters --range_index auto

If ``always`` is specified, range index is always used. It'll be
useful for testing a case that range index is used.

.. groonga-command
.. include:: ../../example/reference/commands/logical_parameters/range_index_always.log
.. logical_parameters --range_index always

If ``never`` is specified, range index is never used. It'll be useful
for testing a case that range index isn't used.

.. groonga-command
.. include:: ../../example/reference/commands/logical_parameters/range_index_never.log
.. logical_parameters --range_index never

Return value
------------

The command returns the current parameters for ``logical_*`` command::

  [
    HEADER,
    {"range_index": HOW_TO_USE_RANGE_INDEX}
  ]

``HOW_TO_USE_RANGE_INDEX`` value is one of the followings:

  * ``"auto"``
  * ``"always"``
  * ``"never"``

See :doc:`/reference/command/output_format` for ``HEADER``.