From 5253e63c5302d75cab796e6420fc96f170b9a6da Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Tue, 2 Dec 2025 11:05:16 -0500 Subject: [PATCH] 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" --- source/index-management/tests/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/index-management/tests/README.md b/source/index-management/tests/README.md index 652196c88f..14399e60fd 100644 --- a/source/index-management/tests/README.md +++ b/source/index-management/tests/README.md @@ -336,3 +336,26 @@ This test fails if it times out waiting for the deletion to succeed. 3. Assert that the command throws an exception containing the string "Attribute mappings missing" due to the `mappings` field missing. + +#### Case 9: Drivers use server default for unspecified name (`"default"`) and type (`"search"`) + +1. Create a collection with the "create" command using a randomly generated name (referred to as `coll0`). + +2. Create a new search index on `coll0` with the following definition: + + ```typescript + { + definition: { + mappings: { dynamic: true } + } + } + ``` + +3. Assert that the command returns the name of the index: `"default"`. + +4. 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 `default` is present and the index has a field `queryable` with a value of `true`. + +5. Assert that `index` has a property `type` whose value is `search`.