You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#. Create a collection with the "create" command using a randomly generated name (referred to as ``coll0``).
229
+
#. Create a new search index on ``coll0`` with the ``createSearchIndex`` helper. Use the following definition:
230
+
231
+
.. code:: typescript
232
+
233
+
{
234
+
name: 'test-search-index-case7-implicit',
235
+
definition: {
236
+
mappings: { dynamic: false }
237
+
}
238
+
}
239
+
240
+
#. Assert that the command returns the name of the index: ``"test-search-index-case7-implicit"``.
241
+
#. Run ``coll0.listSearchIndexes('test-search-index-case7-implicit')`` repeatedly every 5 seconds until the following condition is satisfied and store the value in a variable ``index1``:
242
+
243
+
- An index with the ``name`` of ``test-search-index-case7-implicit`` is present and the index has a field ``queryable`` with a value of ``true``.
244
+
245
+
#. Assert that ``index1`` has a property ``type`` whose value is ``search``
246
+
#. Create a new search index on ``coll0`` with the ``createSearchIndex`` helper. Use the following definition:
247
+
248
+
.. code:: typescript
249
+
250
+
{
251
+
name: 'test-search-index-case7-explicit',
252
+
type: 'search',
253
+
definition: {
254
+
mappings: { dynamic: false }
255
+
}
256
+
}
257
+
258
+
#. Assert that the command returns the name of the index: ``"test-search-index-case7-explicit"``.
259
+
#. Run ``coll0.listSearchIndexes('test-search-index-case7-explicit')`` repeatedly every 5 seconds until the following condition is satisfied and store the value in a variable ``index2``:
260
+
261
+
- An index with the ``name`` of ``test-search-index-case7-explicit`` is present and the index has a field ``queryable`` with a value of ``true``.
262
+
263
+
#. Assert that ``index2`` has a property ``type`` whose value is ``search``
264
+
#. Create a new vector search index on ``coll0`` with the ``createSearchIndex`` helper. Use the following definition:
265
+
266
+
.. code:: typescript
267
+
268
+
{
269
+
name: 'test-search-index-case7-vector',
270
+
type: 'vectorSearch',
271
+
definition: {
272
+
"fields": [
273
+
{
274
+
"type": "vector",
275
+
"path": "plot_embedding",
276
+
"numDimensions": 1536,
277
+
"similarity": "euclidean",
278
+
},
279
+
]
280
+
}
281
+
}
282
+
283
+
#. Assert that the command returns the name of the index: ``"test-search-index-case7-vector"``.
284
+
#. Run ``coll0.listSearchIndexes('test-search-index-case7-vector')`` repeatedly every 5 seconds until the following condition is satisfied and store the value in a variable ``index3``:
285
+
286
+
- An index with the ``name`` of ``test-search-index-case7-vector`` is present and the index has a field ``queryable`` with a value of ``true``.
287
+
288
+
#. Assert that ``index3`` has a property ``type`` whose value is ``vectorSearch``
289
+
#. Create a new vector search index on ``coll0`` with the ``createSearchIndex`` helper. Use the following definition:
290
+
291
+
.. code:: typescript
292
+
293
+
{
294
+
name: 'test-search-index-case7-error',
295
+
definition: {
296
+
"fields": [
297
+
{
298
+
"type": "vector",
299
+
"path": "plot_embedding",
300
+
"numDimensions": 1536,
301
+
"similarity": "euclidean",
302
+
},
303
+
]
304
+
}
305
+
}
306
+
307
+
#. Assert that the command throws an exception due to the ``mappings`` field missing.
0 commit comments