Skip to content

Commit

Permalink
Update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Jun 4, 2016
1 parent 2989f57 commit 3552dcf
Show file tree
Hide file tree
Showing 10 changed files with 405 additions and 319 deletions.
Binary file modified docs/objects.inv
Binary file not shown.
8 changes: 4 additions & 4 deletions docs/reference/commands/logical_select.html
Original file line number Diff line number Diff line change
Expand Up @@ -1649,8 +1649,8 @@ <h3>7.3.34.5.5. Output related parameters<a class="headerlink" href="#output-rel
</div></blockquote>
<div class="section" id="drilldown-label-keys">
<span id="logical-select-drilldown-label-keys"></span><h4>7.3.34.5.7.1. <code class="docutils literal"><span class="pre">drilldown[${LABEL}].keys</span></code><a class="headerlink" href="#drilldown-label-keys" title="Permalink to this headline"></a></h4>
<p>Corresponds to <a class="reference internal" href="select.html#select-drilldown-label-keys"><span class="std std-ref">drilldown[${LABEL}].keys</span></a> in
<a class="reference internal" href="select.html"><span class="doc">select</span></a>. See <a class="reference internal" href="select.html#select-drilldown-label-keys"><span class="std std-ref">drilldown[${LABEL}].keys</span></a> for details.</p>
<p>Corresponds to <a class="reference internal" href="select.html#select-drilldown-label-keys"><span class="std std-ref">drilldowns[${LABEL}].keys</span></a> in
<a class="reference internal" href="select.html"><span class="doc">select</span></a>. See <a class="reference internal" href="select.html#select-drilldown-label-keys"><span class="std std-ref">drilldowns[${LABEL}].keys</span></a> for details.</p>
<p>Here is an example:</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>logical_select \
Expand Down Expand Up @@ -1726,8 +1726,8 @@ <h3>7.3.34.5.5. Output related parameters<a class="headerlink" href="#output-rel
</div>
<div class="section" id="drilldown-label-output-columns">
<span id="logical-select-drilldown-label-output-columns"></span><h4>7.3.34.5.7.2. <code class="docutils literal"><span class="pre">drilldown[${LABEL}].output_columns</span></code><a class="headerlink" href="#drilldown-label-output-columns" title="Permalink to this headline"></a></h4>
<p>Corresponds to <a class="reference internal" href="select.html#select-drilldown-label-output-columns"><span class="std std-ref">drilldown[${LABEL}].output_columns</span></a> in
<a class="reference internal" href="select.html"><span class="doc">select</span></a>. See <a class="reference internal" href="select.html#select-drilldown-label-output-columns"><span class="std std-ref">drilldown[${LABEL}].output_columns</span></a> for
<p>Corresponds to <a class="reference internal" href="select.html#select-drilldown-label-output-columns"><span class="std std-ref">drilldowns[${LABEL}].output_columns</span></a> in
<a class="reference internal" href="select.html"><span class="doc">select</span></a>. See <a class="reference internal" href="select.html#select-drilldown-label-output-columns"><span class="std std-ref">drilldowns[${LABEL}].output_columns</span></a> for
details.</p>
<p>Here is an example:</p>
<p>Execution example:</p>
Expand Down
199 changes: 110 additions & 89 deletions docs/reference/commands/select.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

162 changes: 92 additions & 70 deletions docs/sources/reference/commands/select.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,21 @@ optional::
[adjuster=null]
[drilldown_calc_types=NONE]
[drilldown_calc_target=null]
[sort_keys=null]
[drilldown_sort_keys=null]

``select`` has the following named parameters for advanced drilldown:

* ``drilldown[${LABEL}].keys=null``
* ``drilldown[${LABEL}].sortby=null``
* ``drilldown[${LABEL}].output_columns="_key, _nsubrecs"``
* ``drilldown[${LABEL}].offset=0``
* ``drilldown[${LABEL}].limit=10``
* ``drilldown[${LABEL}].calc_types=NONE``
* ``drilldown[${LABEL}].calc_target=null``
* ``drilldowns[${LABEL}].keys=null``
* ``drilldowns[${LABEL}].sortby=null``
* ``drilldowns[${LABEL}].output_columns="_key, _nsubrecs"``
* ``drilldowns[${LABEL}].offset=0``
* ``drilldowns[${LABEL}].limit=10``
* ``drilldowns[${LABEL}].calc_types=NONE``
* ``drilldowns[${LABEL}].calc_target=null``

.. deprecated:: 6.0.3
``drilldown[...]`` syntax is deprecated, Use ``drilldowns[...]`` instead.

You can use one or more alphabets, digits, ``_`` and ``.`` for
``${LABEL}``. For example, ``parent.sub1`` is a valid ``${LABEL}``.
Expand All @@ -65,15 +70,15 @@ Parameters that have the same ``${LABEL}`` are grouped.

For example, the following parameters specify one drilldown:

* ``--drilldown[label].keys column``
* ``--drilldown[label].sortby -_nsubrecs``
* ``--drilldowns[label].keys column``
* ``--drilldowns[label].sortby -_nsubrecs``

The following parameters specify two drilldowns:

* ``--drilldown[label1].keys column1``
* ``--drilldown[label1].sortby -_nsubrecs``
* ``--drilldown[label2].keys column2``
* ``--drilldown[label2].sortby _key``
* ``--drilldowns[label1].keys column1``
* ``--drilldowns[label1].sortby -_nsubrecs``
* ``--drilldowns[label2].keys column2``
* ``--drilldowns[label2].sortby _key``

Usage
-----
Expand Down Expand Up @@ -557,7 +562,8 @@ more searches aren't executed. And no records are matched.
``query_expansion``
"""""""""""""""""""

Deprecated. Use :ref:`select-query-expander` instead.
.. deprecated:: 3.0.2
Use :ref:`select-query-expander` instead.

.. _select-query-flags:

Expand Down Expand Up @@ -789,14 +795,22 @@ values except ``_score`` are outputted.
``sortby``
""""""""""

.. deprecated:: 6.0.3
Use :ref:`select-sort-keys` instead.

.. _select-sort-keys:

``sort_keys``
"""""""""""""

Specifies sort keys separated by ``,``. Each sort key is column
name.

Here is a simple ``sortby`` usage example.
Here is a simple ``sort_keys`` usage example.

.. groonga-command
.. include:: ../../example/reference/commands/select/sortby_simple.log
.. select Entries --sortby 'n_likes, _id'
.. include:: ../../example/reference/commands/select/sort_keys_simple.log
.. select Entries --sort_keys 'n_likes, _id'
The ``select`` command sorts by ``n_likes`` column value in ascending
order. For records that has the same ``n_likes`` are sorted by ``_id``
Expand All @@ -805,21 +819,21 @@ are the case.

If you want to sort in descending order, add ``-`` before column name.

Here is a descending order ``sortby`` usage example.
Here is a descending order ``sort_keys`` usage example.

.. groonga-command
.. include:: ../../example/reference/commands/select/sortby_descending.log
.. select Entries --sortby '-n_likes, _id'
.. include:: ../../example/reference/commands/select/sort_keys_descending.log
.. select Entries --sort_keys '-n_likes, _id'
The ``select`` command sorts by ``n_likes`` column value in descending
order. But ascending order is used for sorting by ``_id``.

You can use ``_score`` pseudo column in ``sortby`` if you use
You can use ``_score`` pseudo column in ``sort_keys`` if you use
``query`` or ``filter`` parameter.

.. groonga-command
.. include:: ../../example/reference/commands/select/sortby_score_with_query.log
.. select Entries --match_columns content --query fast --sortby -_score --output_columns '_key, _score'
.. include:: ../../example/reference/commands/select/sort_keys_score_with_query.log
.. select Entries --match_columns content --query fast --sort_keys -_score --output_columns '_key, _score'
The ``select`` command sorts matched records by hit score in
descending order and outputs record key and hit score.
Expand Down Expand Up @@ -975,6 +989,14 @@ The ``select`` command outputs the following information:
``drilldown_sortby``
""""""""""""""""""""

.. deprecated:: 6.0.3
Use :ref:`select-drilldown-sort-keys` instead.

.. _select-drilldown-sort-keys:

``drilldown_sort_keys``
"""""""""""""""""""""""

Specifies sort keys for drilldown outputs separated by ``,``. Each
sort key is column name.

Expand Down Expand Up @@ -1363,13 +1385,13 @@ configuration for all drilldowns. For example,
You can use a configuration for each drilldown by the following
parameters:

* ``drilldown[${LABEL}].keys``
* ``drilldown[${LABEL}].sortby``
* ``drilldown[${LABEL}].output_columns``
* ``drilldown[${LABEL}].offset``
* ``drilldown[${LABEL}].limit``
* ``drilldown[${LABEL}].calc_types``
* ``drilldown[${LABEL}].calc_target``
* ``drilldowns[${LABEL}].keys``
* ``drilldowns[${LABEL}].sortby``
* ``drilldowns[${LABEL}].output_columns``
* ``drilldowns[${LABEL}].offset``
* ``drilldowns[${LABEL}].limit``
* ``drilldowns[${LABEL}].calc_types``
* ``drilldowns[${LABEL}].calc_target``

``${LABEL}`` is a variable. You can use the following characters for
``${LABEL}``:
Expand All @@ -1389,14 +1411,14 @@ parameters are used for one drilldown.

For example, there are 2 groups for the following parameters:

* ``--drilldown[label1].keys _key``
* ``--drilldown[label1].output_columns _nsubrecs``
* ``--drilldown[label2].keys tag``
* ``--drilldown[label2].output_columns _key,_nsubrecs``
* ``--drilldowns[label1].keys _key``
* ``--drilldowns[label1].output_columns _nsubrecs``
* ``--drilldowns[label2].keys tag``
* ``--drilldowns[label2].output_columns _key,_nsubrecs``

``drilldown[label1].keys`` and ``drilldown[label1].output_columns``
are grouped. ``drilldown[label2].keys`` and
``drilldown[label2].output_columns`` are also grouped.
``drilldowns[label1].keys`` and ``drilldowns[label1].output_columns``
are grouped. ``drilldowns[label2].keys`` and
``drilldowns[label2].output_columns`` are also grouped.

In ``label1`` group, ``_key`` is used for group key and ``_nsubrecs``
is used for output columns.
Expand All @@ -1407,28 +1429,28 @@ In ``label2`` group, ``tag`` is used for group key and
See document for corresponding ``drilldown_XXX`` parameter to know how
to use it for the following parameters:

* ``drilldown[${LABEL}].sortby``: :ref:`select-drilldown-sortby`
* ``drilldown[${LABEL}].offset``: :ref:`select-drilldown-offset`
* ``drilldown[${LABEL}].limit``: :ref:`select-drilldown-limit`
* ``drilldown[${LABEL}].calc_types``: :ref:`select-drilldown-calc-types`
* ``drilldown[${LABEL}].calc_target``: :ref:`select-drilldown-calc-target`
* ``drilldowns[${LABEL}].sortby``: :ref:`select-drilldown-sortby`
* ``drilldowns[${LABEL}].offset``: :ref:`select-drilldown-offset`
* ``drilldowns[${LABEL}].limit``: :ref:`select-drilldown-limit`
* ``drilldowns[${LABEL}].calc_types``: :ref:`select-drilldown-calc-types`
* ``drilldowns[${LABEL}].calc_target``: :ref:`select-drilldown-calc-target`

The following parameters are needed more description:

* ``drilldown[${LABEL}].keys``
* ``drilldown[${LABEL}].output_columns``
* ``drilldowns[${LABEL}].keys``
* ``drilldowns[${LABEL}].output_columns``

Output format is different a bit. It's also needed more description.

.. _select-drilldown-label-keys:

``drilldown[${LABEL}].keys``
""""""""""""""""""""""""""""
``drilldowns[${LABEL}].keys``
"""""""""""""""""""""""""""""

:ref:`select-drilldown` can specify multiple keys for multiple
drilldowns. But it can't specify multiple keys for one drilldown.

``drilldown[${LABEL}].keys`` can't specify multiple keys for multiple
``drilldowns[${LABEL}].keys`` can't specify multiple keys for multiple
drilldowns. But it can specify multiple keys for one drilldown.

You can specify multiple keys separated by "``,``".
Expand All @@ -1441,8 +1463,8 @@ column values:
.. select Entries \
.. --limit -1 \
.. --output_column tag,n_likes \
.. --drilldown[tag.n_likes].keys tag,n_likes \
.. --drilldown[tag.n_likes].output_columns _value.tag,_value.n_likes,_nsubrecs
.. --drilldowns[tag.n_likes].keys tag,n_likes \
.. --drilldowns[tag.n_likes].output_columns _value.tag,_value.n_likes,_nsubrecs
``tag.n_likes`` is used as the label for the drilldown parameters
group. You can refer grouped keys by ``_value.${KEY_NAME}`` syntax in
Expand All @@ -1451,22 +1473,22 @@ column name to be used by group key. ``tag`` and ``n_likes`` are
``${KEY_NAME}`` in this case.

Note that you can't use ``_value.${KEY_NAME}`` syntax when you just
specify one key as ``drilldown[${LABEL}].keys`` like ``--drilldown[tag].keys
specify one key as ``drilldowns[${LABEL}].keys`` like ``--drilldowns[tag].keys
tag``. You should use ``_key`` for the case. It's the same rule in
:ref:`select-drilldown-output-columns`.

.. _select-drilldown-label-output-columns:

``drilldown[${LABEL}].output_columns``
""""""""""""""""""""""""""""""""""""""
``drilldowns[${LABEL}].output_columns``
"""""""""""""""""""""""""""""""""""""""

It's almost same as :ref:`select-drilldown-output-columns`. The
difference between :ref:`select-drilldown-output-columns` and
``drilldown[${LABEL}].output_columns`` is how to refer group keys.
``drilldowns[${LABEL}].output_columns`` is how to refer group keys.

:ref:`select-drilldown-output-columns` uses ``_key``
:doc:`/reference/columns/pseudo` to refer group
key. ``drilldown[${LABEL}].output_columns`` also uses ``_key``
key. ``drilldowns[${LABEL}].output_columns`` also uses ``_key``
:doc:`/reference/columns/pseudo` to refer group key when you specify
only one group key by :ref:`select-drilldown-label-keys`.

Expand All @@ -1478,12 +1500,12 @@ Here is an example to refer single group key by ``_key``
.. select Entries \
.. --limit 0 \
.. --output_column _id \
.. --drilldown[tag.n_likes].keys tag \
.. --drilldown[tag.n_likes].output_columns _key
.. --drilldowns[tag.n_likes].keys tag \
.. --drilldowns[tag.n_likes].output_columns _key
But you can't refer each group key by ``_key``
:doc:`/reference/columns/pseudo` in
``drilldown[${LABEL}].output_columns``. You need to use
``drilldowns[${LABEL}].output_columns``. You need to use
``_value.${KEY_NAME}`` syntax. ``${KEY_NAME}`` is a column name that is
used for group key in :ref:`select-drilldown-label-keys`.

Expand All @@ -1495,16 +1517,16 @@ Here is an example to refer each group key in multiple group keys by
.. select Entries \
.. --limit 0 \
.. --output_column _id \
.. --drilldown[tag.n_likes].keys tag,n_likes \
.. --drilldown[tag.n_likes].output_columns _value.tag,_value.n_likes
.. --drilldowns[tag.n_likes].keys tag,n_likes \
.. --drilldowns[tag.n_likes].output_columns _value.tag,_value.n_likes
.. tip:: Why ``_value.${KEY_NAME}`` syntax?

It's implementation specific information.

``_key`` is a vector value. The vector value is consists of all
group keys. You can see byte sequence of the vector value by
referring ``_key`` in ``drilldown[${LABEL}].output_columns``.
referring ``_key`` in ``drilldowns[${LABEL}].output_columns``.

There is one grouped record in ``_value`` to refer each grouped
values when you specify multiple group keys to
Expand All @@ -1518,8 +1540,8 @@ Here is an example to refer each group key in multiple group keys by

.. _select-drilldown-label-output-format:

Output format for ``drilldown[${LABEL}]`` style
"""""""""""""""""""""""""""""""""""""""""""""""
Output format for ``drilldowns[${LABEL}]`` style
""""""""""""""""""""""""""""""""""""""""""""""""

There is a difference in output format between :ref:`select-drilldown`
and :ref:`select-drilldown-label-keys`. :ref:`select-drilldown` uses
Expand Down Expand Up @@ -1710,7 +1732,7 @@ If ``select`` fails, error details are in ``HEADER``.
See :doc:`/reference/command/output_format` for ``HEADER``.

There are zero or more ``DRILLDOWN_RESULT``. If no ``drilldown`` and
``drilldown[${LABEL}].keys`` are specified, they are omitted like the
``drilldowns[${LABEL}].keys`` are specified, they are omitted like the
following::

[
Expand All @@ -1733,7 +1755,7 @@ column1, column2"``, multiple ``DRILLDOWN_RESULT`` exist::
]
]

If ``drilldown[${LABEL}].keys`` is used, only one ``DRILLDOWN_RESULT``
If ``drilldowns[${LABEL}].keys`` is used, only one ``DRILLDOWN_RESULT``
exist::

[
Expand All @@ -1745,7 +1767,7 @@ exist::
]

``DRILLDOWN_RESULT`` format is different between ``drilldown`` and
``drilldown[${LABEL}].keys``. It's described later.
``drilldowns[${LABEL}].keys``. It's described later.

``SEARCH_RESULT`` is the following format::

Expand Down Expand Up @@ -1844,7 +1866,7 @@ Here is an example ``RECORDS``::
]

``DRILLDOWN_RESULT`` format is different between ``drilldown`` and
``drilldown[${LABEL}].keys``.
``drilldowns[${LABEL}].keys``.

``drilldown`` uses the same format as ``SEARCH_RESULT``::

Expand All @@ -1857,8 +1879,8 @@ Here is an example ``RECORDS``::
And ``drilldown`` generates one or more ``DRILLDOWN_RESULT`` when
:ref:`select-drilldown` has one ore more keys.

``drilldown[${LABEL}].keys`` uses the following format. Multiple
``drilldown[${LABEL}].keys`` are mapped to one object (key-value
``drilldowns[${LABEL}].keys`` uses the following format. Multiple
``drilldowns[${LABEL}].keys`` are mapped to one object (key-value
pairs)::

{
Expand All @@ -1880,7 +1902,7 @@ pairs)::
]
}

Each ``drilldown[${LABEL}].keys`` corresponds to the following::
Each ``drilldowns[${LABEL}].keys`` corresponds to the following::

"LABEL": [
[N_HITS],
Expand All @@ -1897,7 +1919,7 @@ The following value part is the same format as ``SEARCH_RESULT``::
]

See also :ref:`select-drilldown-label-output-format` for
``drilldown[${LABEL}]`` style drilldown output format.
``drilldowns[${LABEL}]`` style drilldown output format.


See also
Expand Down
Binary file modified ja/docs/objects.inv
Binary file not shown.

0 comments on commit 3552dcf

Please sign in to comment.