Skip to content

Commit 38aaea0

Browse files
committed
Amend description of use_index on /{db}/_find
The semantics of Mango's `use_index` query parameter has changed over time but this has not been reflected in the documentation, which causes a lot of confusion. The `use_index` parameter was introduced in 1b0426a to force the index selection to a specific index. Unfortunately, this did not work out well in practice, so 743bd88 added a fallback mechanism to make it less brittle. With that, `use_index` became only a "hint" not an "instruction".
1 parent 45aba68 commit 38aaea0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/docs/src/api/database/find.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@
4242
should be returned. If it is omitted, the entire object is returned.
4343
More information provided in the section on :ref:`filtering fields
4444
<find/filter>`. *Optional*
45-
:<json string|array use_index: Instruct a query to use a specific index.
46-
Specified either as ``"<design_document>"`` or
47-
``["<design_document>", "<index_name>"]``. *Optional*
45+
:<json string|array use_index: Request a query to use a specific
46+
index. Specified either as ``"<design_document>"`` or
47+
``["<design_document>", "<index_name>"]``. It is not
48+
guaranteed that the index will be actually used because if the
49+
index is not valid for the selector, fallback to a valid index
50+
is attempted. Therefore that is more like a hint. When
51+
fallback occurs, the details are given in the ``warning``
52+
field of the response. *Optional*
4853
:<json boolean conflicts: Include conflicted documents if ``true``.
4954
Intended use is to easily find conflicted documents, without an
5055
index or view. Default is ``false``. *Optional*

0 commit comments

Comments
 (0)