Skip to content

Commit 8cea57d

Browse files
committed
DRIVERS-3345 Ensure that not specifying the name and type when creating a search index will result in the name being "default" and the type being "search"
1 parent c12c50e commit 8cea57d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

source/index-management/tests/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,27 @@ This test fails if it times out waiting for the deletion to succeed.
336336

337337
3. Assert that the command throws an exception containing the string "Attribute mappings missing" due to the `mappings`
338338
field missing.
339+
340+
#### Case 9: Drivers use server default for unspecified name (`"default"`) and type (`"search"`)
341+
342+
1. Create a collection with the "create" command using a randomly generated name (referred to as `coll0`).
343+
344+
2. Create a new search index on `coll0` with the following definition:
345+
346+
```typescript
347+
{
348+
definition: {
349+
mappings: { dynamic: true }
350+
}
351+
}
352+
```
353+
354+
3. Assert that the command returns the name of the index: `"default"`.
355+
356+
4. Run `coll0.listSearchIndexes()` repeatedly every 5 seconds until the following condition is satisfied and store the
357+
value in a variable `index`:
358+
359+
- An index with the `name` of `default` is present and the index has a field `queryable` with a value
360+
of `true`.
361+
362+
5. Assert that `index` has a property `type` whose value is `search`.

0 commit comments

Comments
 (0)