Skip to content
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

DRIVERS-2761 do not apply readConcern or writeConcern to search index commands #1474

Merged
merged 9 commits into from
Dec 12, 2023
6 changes: 5 additions & 1 deletion source/index-management/index-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,8 @@ Where are read concern and write concern?
These commands internally proxy the search index management commands to a separate process that runs alongside an Atlas cluster. As such, read concern and
write concern are not relevant for the search index management commands.

Drivers MUST NOT apply a read concern or write concern to the commands. Atlas search index management commands return an error if a ``readConcern`` or ``writeConcern`` field is present in the command.

Consistency with Existing APIs
------------------------------

Expand Down Expand Up @@ -1136,4 +1138,6 @@ Changelog
:2023-05-10: Merge index enumeration and index management specs and get rid of references
to legacy server versions.
:2023-05-18: Add the search index management API.
:2023-07-27: Add search index management clarifications.
:2023-07-27: Add search index management clarifications.
:2023-11-08: Clarify that ``readConcern`` and ``writeConcern`` must not be
kevinAlbs marked this conversation as resolved.
Show resolved Hide resolved
applied to search index managment commands.
23 changes: 23 additions & 0 deletions source/index-management/tests/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,26 @@ Case 5: ``dropSearchIndex`` suppresses namespace not found errors

#. Create a driver-side collection object for a randomly generated collection name. Do not create this collection on the server.
#. Run a ``dropSearchIndex`` command and assert that no error is thrown.

Case 6: Driver can successfully create and list search indexes with non-default readConcern and writeConcern
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#. Create a collection with the "create" command using a randomly generated name (referred to as ``coll0``).
#. Apply a write concern ``WriteConcern(w=1)`` and a read concern with ``ReadConcern(level="local")`` to ``coll0``.
vbabanin marked this conversation as resolved.
Show resolved Hide resolved
#. Create a new search index on ``coll0`` with the ``createSearchIndex`` helper. Use the following definition:

.. code:: typescript

{
name: 'test-search-index-case6',
definition: {
mappings: { dynamic: false }
}
}

#. Assert that the command returns the name of the index: ``"test-search-index-case6"``.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied and store the value in a variable ``index``:

- An index with the ``name`` of ``test-search-index-case6`` is present and the index has a field ``queryable`` with a value of ``true``.

#. Assert that ``index`` has a property ``latestDefinition`` whose value is ``{ 'mappings': { 'dynamic': false } }``

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading