Skip to content

Commit

Permalink
Amend description of use_index on /{db}/_find
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
pgj committed Oct 4, 2023
1 parent 45aba68 commit aaf9005
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/docs/src/api/database/find.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@
should be returned. If it is omitted, the entire object is returned.
More information provided in the section on :ref:`filtering fields
<find/filter>`. *Optional*
:<json string|array use_index: Instruct a query to use a specific index.
Specified either as ``"<design_document>"`` or
``["<design_document>", "<index_name>"]``. *Optional*
:<json string|array use_index: Request a query to use a specific
index. Specified either as ``"<design_document>"`` or
``["<design_document>", "<index_name>"]``. It is not
guaranteed that the index will be actually used because if the
index is not valid for the selector, fallback to a valid index
is attempted. Therefore that is more like a hint. When
fallback occurs, the details are given in the ``warning``
field of the response. *Optional*
:<json boolean conflicts: Include conflicted documents if ``true``.
Intended use is to easily find conflicted documents, without an
index or view. Default is ``false``. *Optional*
Expand Down

0 comments on commit aaf9005

Please sign in to comment.