Skip to content

Commit 78554de

Browse files
address comments from Jerome
1 parent bd2092e commit 78554de

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

source/index-management/index-management.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,3 +1128,4 @@ Changelog
11281128
:2023-05-10: Merge index enumeration and index management specs and get rid of references
11291129
to legacy server versions.
11301130
:2023-05-18: Add the search index management API.
1131+
:2023-07-17: Add search index management clarifications.

source/index-management/tests/README.rst

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Case 1: Driver can successfully create and list search indexes
8080
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8181

8282
#. Create a collection with a randomly generated name (referred to as ``coll0``).
83-
#. Create a new search index on ``coll0`` with the following definition:
83+
#. Create a new search index on ``coll0`` with the ``createSearchIndex`` helper. Use the following definition:
8484

8585
.. code:: typescript
8686
@@ -91,17 +91,17 @@ Case 1: Driver can successfully create and list search indexes
9191
}
9292
}
9393
94-
#. Assert that the command does not error and the server responds with a success.
94+
#. Assert that the command returns the name of the index: ``"test-search-index"``.
9595
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied:
96-
1. An index with the ``name`` of ``test-search-index`` is present. This index is referred to as ``index``.
97-
2. The ``latestDefinition`` property of the search index has the field ``queryable`` with a value of ``true``.
96+
1. An index with the ``name`` of ``test-search-index`` is present and index has the field ``queryable`` with a value of ``true``.
97+
9898
#. Assert that ``index`` has a property ``mappings`` whose value is ``{ dynamic: false }``
9999

100100
Case 2: Driver can successfully create multiple indexes in batch
101101
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102102

103103
#. Create a collection with a randomly generated name (referred to as ``coll0``).
104-
#. Create two new search indexes on ``coll0`` with the ``createSearchIndexes`` command. Use the following
104+
#. Create two new search indexes on ``coll0`` with the ``createSearchIndexes`` helper. Use the following
105105
definitions when creating the indexes. These definitions are referred to as ``indexDefinitions``.
106106

107107
.. code:: typescript
@@ -119,11 +119,11 @@ Case 2: Driver can successfully create multiple indexes in batch
119119
}
120120
}
121121
122-
#. Assert that the command does not error and the server responds with a success.
122+
#. Assert that the command returns an array containing the new indexes' names: ``["test-search-index-1", "test-search-index-2"]``.
123123
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied. Store
124124
the result in ``indexes``.
125-
1. An index with the ``name`` of ``test-search-index-1`` is present. The ``latestDefinition`` property of the search index has the field ``queryable`` with a value of ``true``.
126-
2. An index with the ``name`` of ``test-search-index-2`` is present. The ``latestDefinition`` property of the search index has the field ``queryable`` with a value of ``true``.
125+
1. An index with the ``name`` of ``test-search-index-1`` is present and index has the field ``queryable`` with a value of ``true``.
126+
2. An index with the ``name`` of ``test-search-index-2`` is present and index has the field ``queryable`` with a value of ``true``.
127127
#. For each ``index`` in ``indexDefinitions``
128128
1. Find the matching index definition in ``indexes`` by matching on ``index.name``. If no index exists, raise an error.
129129
2. Assert that the matching index ``mappings``, whose value is ``{ dynamic: false }``
@@ -143,10 +143,9 @@ Case 3: Driver can successfully drop search indexes
143143
}
144144
}
145145
146-
#. Assert that the command does not error and the server responds with a success.
146+
#. Assert that the command returns the name of the index: ``"test-search-index"``.
147147
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied:
148-
1. An index with the ``name`` of ``test-search-index`` is present. This index is referred to as ``index``.
149-
2. The ``latestDefinition`` property of the search index has the field ``queryable`` with a value of ``true``.
148+
1. An index with the ``name`` of ``test-search-index`` is present and index has the field ``queryable`` with a value of ``true``.
150149

151150
#. Run a ``dropSearchIndexes`` on ``coll0``, using ``test-search-index`` for the name.
152151
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until ``listSearchIndexes`` returns an empty array.
@@ -168,10 +167,9 @@ Case 4: Driver can update a search index
168167
}
169168
}
170169
171-
#. Assert that the command does not error and the server responds with a success.
170+
#. Assert that the command returns the name of the index: ``"test-search-index"``.
172171
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied:
173-
1. An index with the ``name`` of ``test-search-index`` is present. This index is referred to as ``index``.
174-
2. The ``latestDefinition`` property of the search index has the field ``queryable`` with a value of ``true``.
172+
1. An index with the ``name`` of ``test-search-index`` is present and index has the field ``queryable`` with a value of ``true``.
175173

176174
#. Run a ``updateSearchIndex`` on ``coll0``, using the following definition.
177175

@@ -187,8 +185,8 @@ Case 4: Driver can update a search index
187185
#. Assert that the command does not error and the server responds with a success.
188186
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied:
189187
1. An index with the ``name`` of ``test-search-index`` is present. This index is referred to as ``index``.
190-
2. The ``latestDefinition`` property of the search index has the field ``queryable`` with a value of ``true``.
191-
3. The ``latestDefinition`` property of the search index has the field ``status`` with the value of ``READY``.
188+
2. The index has a field ``queryable`` with a value of ``true``.
189+
3. The index has a ``latestDefinition`` property. The ``latestDefinition`` field has a property ``status`` with the value of ``READY``.
192190

193191
#. Assert that an index is present with the name ``test-search-index`` and the definition has a
194192
property ``mappings``, whose value is ``{ dynamic: true }``

0 commit comments

Comments
 (0)