-
Notifications
You must be signed in to change notification settings - Fork 43
Index options API #3562
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
Index options API #3562
Conversation
7108927
to
2cd5472
Compare
4833b3b
to
623e8d9
Compare
867671a
to
dbe83b8
Compare
dbe83b8
to
1609686
Compare
--- | ||
- ['Gamma!', 55, 'This is the third tuple!'] | ||
... | ||
Below are few examples of using ``min``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, thanks!
5934251
to
d4aa371
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an impressive work!
Some minor edits and suggestions from my side.
Although, I couldn't make myself actually check all 100500 links you've changed on different pages.
@@ -188,31 +188,43 @@ Example: ``nil``. | |||
|
|||
.. _index-box_boolean: | |||
|
|||
**boolean**. A boolean is either ``true`` or ``false``. | |||
**boolean** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe convert all bold type names to headings? This will be a better semantic markup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, will do
doc/how-to/db/indexes.rst
Outdated
@@ -64,99 +64,58 @@ Index operations | |||
Index operations are automatic: if a data manipulation request changes a tuple, | |||
then it also changes the index keys defined for the tuple. | |||
|
|||
#. Let's create a sample space named ``tester`` and | |||
put it in a variable ``my_space``: | |||
#. Let's create a sample space named ``bands``: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#. Let's create a sample space named ``bands``: | |
#. Create a sample space named ``bands``: |
Nit: for consistency, let's use direct second person instructions in all new content.
doc/how-to/db/indexes.rst
Outdated
.. literalinclude:: /code_snippets/test/indexes/index_select_test.lua | ||
:language: lua | ||
:lines: 40 | ||
:dedent: | ||
|
||
**There are the following SELECT variations:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**There are the following SELECT variations:** | |
There are the following SELECT variations: |
.. literalinclude:: /code_snippets/test/indexes/index_select_test.lua | ||
:language: lua | ||
:lines: 98-106 | ||
:dedent: | ||
|
||
The :ref:`comparison operators <box_index-iterator-types>` are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls fix the punctuation in the list below.
.. code-block:: tarantoolsession | ||
|
||
tarantool> my_space = box.schema.space.create('tester') | ||
.. literalinclude:: /code_snippets/test/indexes/index_select_test.lua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code reuse on this page is really awesome 👍
(1) Create a Lua function. | ||
(2) Add the function name to a predefined global variable, which has the ``table`` type. | ||
(3) Call the function on the ``index_object``: ``index_object:function-name([parameters])``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(1) Create a Lua function. | |
(2) Add the function name to a predefined global variable, which has the ``table`` type. | |
(3) Call the function on the ``index_object``: ``index_object:function-name([parameters])``. | |
1. Create a Lua function. | |
2. Add the function name to a predefined global variable, which has the ``table`` type. | |
3. Call the function on the ``index_object``: ``index_object:function-name([parameters])``. |
Convert to the usual list formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step 2: maybe naviagate reader to the functions list below or move the list inside this procedure?
|
||
There are three predefined global variables: | ||
Alternatively, user-defined functions can be made available for only one index, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, user-defined functions can be made available for only one index, | |
Alternatively, you can make a user-defined function available for only one index |
Simplify the sentence a bit and fix punctuation
Alternatively, user-defined methods can be made available for only one index, | ||
by calling ``getmetatable(index_object)`` and then adding the function name to the | ||
meta table. | ||
**Example 1:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add text descriptions?
|
||
.. method:: user_defined() | ||
(1) Create a Lua function. | ||
(2) Add the function name to a predefined global variable, which has the ``table`` type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure looks awkward with only one "predefined global variable" below.
Also, please fix the step number formatting.
@@ -1070,7 +1070,7 @@ msgstr "" | |||
"box.space.tester:create_index('i',{parts={{field = 1, type = 'string'}}})" | |||
|
|||
msgid "" | |||
"Make a function. The function expects a tuple. In this example it will work " | |||
"Make a function. The function expects a tuple. In this example, it will work " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Make a function. The function expects a tuple. In this example, it will work " | |
"Create a function. The function expects a tuple. In this example, it will work " |
Same for "Make a space"
b004a68
to
53ce704
Compare
53ce704
to
da89114
Compare
The #3227 issue is fixed as a part of index docs refactoring. The next steps of improving docs for indexes are described in this issue: #3572.
Here are the changes directly related to #3227:
collation
option is added to the space_object:format() description.Fixes related to feedback issues for index docs:
Changes related to index docs refactoring:
index_opts
andkey_part
objects with all their members.Index field types
table from the API as it duplicates the corresponding table in the main topic. All links are updated.index_select_test.lua
for referenced examples: