Skip to content

Improve box.index:min/max function description #2798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions doc/reference/reference_lua/box_index/max.rst
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
.. _box_index-max:
.. _box_index-max:

===============================================================================
index_object:max()
===============================================================================
==================

.. class:: index_object
.. class:: index_object

.. method:: max([key])
.. method:: max([key])

Find the maximum value in the specified index.

:param index_object index_object: an :ref:`object reference
<app_server-object_reference>`.
<app_server-object_reference>`
:param scalar/table key: values to be matched against the index key

:return: the tuple for the last key in the index. If optional ``key`` value
is supplied, returns the last key which is less than or equal to
``key`` value.
Starting with Tarantool version 2.0, ``index_object:max``(``key``
value) returns nothing
if ``key`` value is not equal to a value in the index.
:return: the tuple for the last key in the index. If the optional ``key`` value
is supplied, returns the last key that is less than or equal to ``key``.
Starting with :doc:`Tarantool 2.0.4 </release/2.1.2>`, ``index_object:max(key)``
returns nothing if ``key`` doesn't match any value in the index.
:rtype: tuple

**Possible errors:** index is not of type 'TREE'.

**Complexity factors:** Index size, Index type.
**Complexity factors:** index size, index type.

**Example:**

.. code-block:: tarantoolsession
.. code-block:: tarantoolsession

tarantool> box.space.tester.index.primary:max()
---
Expand Down
20 changes: 9 additions & 11 deletions doc/reference/reference_lua/box_index/min.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
.. _box_index-min:

===============================================================================
index_object:min()
===============================================================================
==================

.. class:: index_object
.. class:: index_object

.. method:: min([key])
.. method:: min([key])

Find the minimum value in the specified index.

:param index_object index_object: an :ref:`object reference
<app_server-object_reference>`.
:param scalar/table key: values to be matched against the index key

:return: the tuple for the first key in the index. If optional
``key`` value is supplied, returns the first key which
is greater than or equal to ``key`` value.
Starting with Tarantool version 2.0, index_object:min(``key``
value) will return nothing
if ``key`` value is not equal to a value in the index.
:return: the tuple for the first key in the index. If the optional
``key`` value is supplied, returns the first key that is greater than or equal to ``key``.
Starting with :doc:`Tarantool 2.0.4 </release/2.1.2>`,
``index_object:min(key)`` returns nothing
if ``key`` doesn't match any value in the index.
:rtype: tuple

**Possible errors:** index is not of type 'TREE'.
Expand All @@ -28,7 +26,7 @@ index_object:min()

**Example:**

.. code-block:: tarantoolsession
.. code-block:: tarantoolsession

tarantool> box.space.tester.index.primary:min()
---
Expand Down
23 changes: 11 additions & 12 deletions locale/ru/LC_MESSAGES/reference/reference_lua/box_index/max.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgstr "Поиск максимального значения в указанн
msgid "Parameters"
msgstr "Параметры"

msgid "an :ref:`object reference <app_server-object_reference>`."
msgstr ":ref:`ссылка на объект <app_server-object_reference>`."
msgid "an :ref:`object reference <app_server-object_reference>`"
msgstr ":ref:`ссылка на объект <app_server-object_reference>`"

msgid "values to be matched against the index key"
msgstr "значения для сопоставления с ключом индекса"
Expand All @@ -18,16 +18,15 @@ msgid "return"
msgstr "возвращает"

msgid ""
"the tuple for the last key in the index. If optional ``key`` value is "
"supplied, returns the last key which is less than or equal to ``key`` value."
" Starting with Tarantool version 2.0, ``index_object:max``(``key`` value) "
"returns nothing if ``key`` value is not equal to a value in the index."
"the tuple for the last key in the index. If the optional ``key`` value is "
"supplied, returns the last key that is less than or equal to ``key``."
" Starting with :doc:`Tarantool 2.0.4 </release/2.1.2>`, ``index_object:max(key)``"
" returns nothing if ``key`` doesn't match any value in the index."
msgstr ""
"кортеж для последнего ключа в индексе. Если указано необязательное значение "
"ключа ``key``, будет выведен последний ключ, который меньше или равен "
"значению ключа ``key``. Начиная с версии Tarantool'а 2.0, index:max(значение"
" ``key``) не вернет ничего, если значение ``key`` не равно значению в "
"индексе."
"значению ключа ``key``. Начиная с версии :doc:`Tarantool 2.0.4 </release/2.1.2>`,"
" ``index:max(key)`` не возвращает ничего, если индекс не содержит значения ``key``."

msgid "rtype"
msgstr "тип возвращаемого значения"
Expand All @@ -36,10 +35,10 @@ msgid "tuple"
msgstr "tuple"

msgid "**Possible errors:** index is not of type 'TREE'."
msgstr "**Возможные ошибки:** тип индекса не 'TREE'"
msgstr "**Возможные ошибки:** тип индекса не 'TREE'."

msgid "**Complexity factors:** Index size, Index type."
msgstr "**Факторы сложности:** Размер индекса, тип индекса"
msgid "**Complexity factors:** index size, index type."
msgstr "**Факторы сложности:** размер индекса, тип индекса."

msgid "**Example:**"
msgstr "**Пример:**"
Expand Down
12 changes: 6 additions & 6 deletions locale/ru/LC_MESSAGES/reference/reference_lua/box_index/min.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ msgid "return"
msgstr "возвращает"

msgid ""
"the tuple for the first key in the index. If optional ``key`` value is "
"supplied, returns the first key which is greater than or equal to ``key`` "
"value. Starting with Tarantool version 2.0, index_object:min(``key`` value) "
"will return nothing if ``key`` value is not equal to a value in the index."
"the tuple for the first key in the index. If the optional ``key`` value is "
"supplied, returns the first key that is greater than or equal to ``key``. "
"Starting with :doc:`Tarantool 2.0.4 </release/2.1.2>`, ``index_object:min(key)`` "
"returns nothing if ``key`` doesn't match any value in the index."
msgstr ""
"кортеж для первого ключа в индексе. Если указано необязательное значение "
"ключа ``key``, будет выведен первый ключ, который больше или равен значению "
"ключа ``key``. Начиная с версии Tarantool 2.0, index:min(значение ``key``)"
" не вернет ничего, если значение ``key`` не равно значению в индексе."
"ключа ``key``. Начиная с версии :doc:`Tarantool 2.0.4 </release/2.1.2>`, ``index:min(key)``"
" не вернет ничего, если индекс не содержит значения ``key``."

msgid "rtype"
msgstr "тип возвращаемого значения"
Expand Down