diff --git a/doc/reference/reference_lua/box_schema/func_create.rst b/doc/reference/reference_lua/box_schema/func_create.rst index 6bb8193fc1..1e3e0d6ada 100644 --- a/doc/reference/reference_lua/box_schema/func_create.rst +++ b/doc/reference/reference_lua/box_schema/func_create.rst @@ -103,6 +103,10 @@ box.schema.func.create() ``true`` means that the function should be deterministic, ``false`` means that the function may or may not be deterministic. + * ``is_multikey`` = ``true|false`` (default = ``false``)--- + if ``true`` is set in the function definition for a functional index, the function returns multiple keys. + For details, see the :ref:`example `. + * ``body`` = function definition (default = nil) - string; the function definition. diff --git a/doc/reference/reference_lua/box_space/create_index.rst b/doc/reference/reference_lua/box_space/create_index.rst index eb3f9cbe72..d9ab0894a3 100644 --- a/doc/reference/reference_lua/box_space/create_index.rst +++ b/doc/reference/reference_lua/box_space/create_index.rst @@ -9,7 +9,7 @@ On this page: * :ref:`Allowing null for an indexed key ` * :ref:`Creating an index using field names instead of field numbers ` * :ref:`Creating an index using the path option for map fields (JSON-path indexes) ` -* :ref:`Creating an multikey index using the path option with [*] ` +* :ref:`Creating a multikey index using the path option with [*] ` * :ref:`Creating a functional index ` .. class:: space_object @@ -638,10 +638,12 @@ Here is the full code of the example: box.space.tester.index.func_idx:select('w') box.space.tester.index.func_idx:select(box.func.my_func:call({{'tester', 'wombat'}})); +.. _box_space-index_func_multikey: + Functions for functional indexes can return **multiple keys**. Such functions are called "multikey" functions. -The ``box.func.create`` options must include ``opts = {is_multikey = true}``. +To create a multikey function, the options of ``box.schema.func.create()`` must include ``is_multikey = true``. The return value must be a table of tuples. If a multikey function returns N tuples, then N keys will be added to the index. @@ -665,7 +667,7 @@ N tuples, then N keys will be added to the index. {body = lua_code, is_deterministic = true, is_sandboxed = true, - opts = {is_multikey = true}}) + is_multikey = true}) idx = s:create_index('addr', {unique = false, func = 'address', parts = {{field = 1, type = 'string',