From e09b124d7dbabc011a35825b2ed1bd8267970b1d Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 7 Feb 2025 14:51:48 -0500 Subject: [PATCH 1/6] DOCSP-43365: type specification for createSearchIndex(es) --- source/includes/extracts-note.yaml | 2 +- source/includes/indexes/indexes.php | 58 +++++++++------ source/indexes/atlas-search-index.txt | 71 ++++++++++++------- .../MongoDBCollection-createIndexes.txt | 1 - .../MongoDBCollection-createSearchIndex.txt | 49 +++++++------ .../MongoDBCollection-createSearchIndexes.txt | 10 ++- 6 files changed, 115 insertions(+), 76 deletions(-) diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml index 69346085..cf8b8480 100644 --- a/source/includes/extracts-note.yaml +++ b/source/includes/extracts-note.yaml @@ -20,7 +20,7 @@ content: | --- ref: note-atlas-search-async content: | - Atlas Search indexes are managed asynchronously. After creating or updating an + Atlas Search and Vector Search indexes are managed asynchronously. After creating or updating an index, you can periodically execute :phpmethod:`MongoDB\Collection::listSearchIndexes()` and check the ``queryable`` :manual:`output field ` diff --git a/source/includes/indexes/indexes.php b/source/includes/indexes/indexes.php index 3b293fb1..f286125f 100644 --- a/source/includes/indexes/indexes.php +++ b/source/includes/indexes/indexes.php @@ -57,36 +57,48 @@ // end-index-array-query // start-create-search-index -$indexName = $collection->createSearchIndex( +$searchIndexName = $collection->createSearchIndex( ['mappings' => ['dynamic' => true]], ['name' => 'mySearchIdx'] ); // end-create-search-index -// start-create-search-indexes -$indexNames = $collection->createSearchIndexes( +// start-create-vector-index +$vectorSearchIndexName = $collection->createSearchIndex( [ - [ - 'name' => 'SearchIdx_dynamic', - 'definition' => ['mappings' => ['dynamic' => true]], - ], - [ - 'name' => 'SearchIdx_simple', - 'definition' => [ - 'mappings' => [ - 'dynamic' => false, - 'fields' => [ - 'title' => [ - 'type' => 'string', - 'analyzer' => 'lucene.simple' - ] - ] - ] - ], - ], - ] + 'fields' => [[ + 'type' => 'vector', + 'path' => 'plot_embedding', + 'numDimensions' => 1536, + 'similarity' => 'dotProduct' + ]] + ], + ['name' => 'myVSidx', 'type' => 'vectorSearch'] +); +// end-create-vector-index + +// start-create-multiple-indexes +$indexNames = $collection->createSearchIndexes( + [ + [ + 'name' => 'SearchIdx', + 'definition' => ['mappings' => ['dynamic' => true]], + ], + [ + 'name' => 'VSidx', + 'type' => 'vectorSearch', + 'definition' => [ + 'fields' => [[ + 'type' => 'vector', + 'path' => 'plot_embedding', + 'numDimensions' => 1536, + 'similarity' => 'dotProduct' + ]] + ], + ], + ] ); -// end-create-search-indexes +// end-create-multiple-indexes // start-list-search-indexes foreach ($collection->listSearchIndexes() as $indexInfo) { diff --git a/source/indexes/atlas-search-index.txt b/source/indexes/atlas-search-index.txt index eb8762aa..225bb44e 100644 --- a/source/indexes/atlas-search-index.txt +++ b/source/indexes/atlas-search-index.txt @@ -20,16 +20,19 @@ Atlas Search Indexes Overview -------- -The MongoDB Atlas Search feature enables you to perform full-text -searches on collections hosted on Atlas. Before you can perform Atlas -Search queries, you must create indexes that specify which -fields to index and how they are indexed. +In this guide, you can learn how to programmatically manage your Atlas +Search and Atlas Vector Search indexes by using the {+library-short+}. -To learn more about Atlas Search, see the :atlas:`Atlas Search Overview -`. +The Atlas Search feature enables you to perform full-text searches on +collections hosted on MongoDB Atlas. To learn more about Atlas Search, +see the :atlas:`Atlas Search Overview `. + +Atlas Vector Search enables you to perform semantic searches on vector +embeddings stored in MongoDB Atlas. To learn more about Atlas Vector Search, +see the :atlas:`Atlas Vector Search Overview `. You can use the following methods on a ``MongoDB\Collection`` instance -to manage your Atlas Search indexes: +to manage your Atlas Search and Vector Search indexes: - ``MongoDB\Collection::createSearchIndex()`` - ``MongoDB\Collection::createSearchIndexes()`` @@ -37,15 +40,16 @@ to manage your Atlas Search indexes: - ``MongoDB\Collection::updateSearchIndex()`` - ``MongoDB\Collection::dropSearchIndex()`` -.. note:: Atlas Search Index Management is Asynchronous +.. note:: Search and Vector Search Index Management is Asynchronous - The {+php-library+} manages Atlas Search indexes asynchronously. The - library methods described in the following sections return the server - response immediately, but the changes to your Search indexes take - place in the background and might not complete until some time later. + The {+php-library+} manages Atlas Search and Vector Search indexes + asynchronously. The library methods described in the following + sections return the server response immediately, but the changes to + your Search indexes take place in the background and might not + complete until some time later. The following sections provide code examples that demonstrate how to use -each Atlas Search index management method. +each of the preceding methods. .. _php-atlas-search-index-create: @@ -53,8 +57,9 @@ Create a Search Index --------------------- You can use the ``createSearchIndex()`` method to create a single Atlas -Search index on a collection, or the ``createSearchIndexes()`` method to -create multiple indexes simultaneously. +Search or Vector Search index on a collection, or the +``createSearchIndexes()`` method to create multiple indexes +simultaneously. The following code example shows how to create a single Atlas Search index: @@ -64,17 +69,30 @@ index: :start-after: start-create-search-index :end-before: end-create-search-index -The following code example shows how to create multiple Atlas Search -indexes: +The following code example shows how to create a single Atlas Vector +Search index: + +.. literalinclude:: /includes/indexes/indexes.php + :language: php + :start-after: start-create-vector-index + :end-before: end-create-vector-index + +The following code example shows how to create Search and +Vector Search indexes in one call: .. literalinclude:: /includes/indexes/indexes.php :language: php - :start-after: start-create-search-indexes - :end-before: end-create-search-indexes + :start-after: start-create-multiple-indexes + :end-before: end-create-multiple-indexes + +After you create Atlas Search or Atlas Vector Search indexes, you can +perform the corresponding query types on your documents. -After you create a Search index, you can perform Atlas Search queries on -your collection. To learn more, see :atlas:`Create and Run Atlas Search -Queries ` in the Atlas documentation. +.. + TODO uncomment when https://github.com/mongodb/docs-php-library/pull/197 is merged + To learn more, see the following guides: + - :ref:`php-atlas-search` + - :ref:`php-vector-search` .. _php-atlas-search-index-list: @@ -82,7 +100,7 @@ List Search Indexes ------------------- You can use the ``listSearchIndexes()`` method to return an array of the -Atlas Search indexes on a collection: +Atlas Search and Vector Search indexes on a collection: .. literalinclude:: /includes/indexes/indexes.php :language: php @@ -96,9 +114,8 @@ Update a Search Index --------------------- You can use the ``updateSearchIndex()`` -method to update an Atlas Search index. You can use this method to -change the name of a Search index or change the configuration of the -index. +method to update an Atlas Search or Vector Search index. You can use this method to +change the name or configuration of an existing index. The following code shows how to update a search index to use a simple analyzer on the ``title`` field: @@ -115,7 +132,7 @@ Delete a Search Index --------------------- You can use the ``dropSearchIndex()`` method to remove an Atlas Search -index from a collection. +or Vector Search index from a collection. The following code shows how to delete the Atlas Search index named ``mySearchIdx``: diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt index b1f4c7c7..244b3bec 100644 --- a/source/reference/method/MongoDBCollection-createIndexes.txt +++ b/source/reference/method/MongoDBCollection-createIndexes.txt @@ -2,7 +2,6 @@ MongoDB\\Collection::createIndexes() ==================================== - .. contents:: On this page :local: :backlinks: none diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt index 840281ec..cf1580cc 100644 --- a/source/reference/method/MongoDBCollection-createSearchIndex.txt +++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt @@ -4,7 +4,6 @@ MongoDB\\Collection::createSearchIndex() .. versionadded:: 1.17 - .. contents:: On this page :local: :backlinks: none @@ -16,14 +15,14 @@ Definition .. phpmethod:: MongoDB\Collection::createSearchIndex() - Create an Atlas Search index for the collection. + Create an Atlas Search or Vector Search index for the collection. .. code-block:: php - function createSearchIndex( - array|object $definition, - array $options = [] - ): string + function createSearchIndex( + array|object $definition, + array $options = [] + ): string .. include:: /includes/extracts/note-atlas-search-requirement.rst @@ -38,28 +37,33 @@ Parameters An array specifying the desired options. .. list-table:: - :header-rows: 1 - :widths: 20 20 80 + :header-rows: 1 + :widths: 20 20 80 - * - Name - - Type - - Description + * - Name + - Type + - Description - * - comment - - mixed - - .. include:: /includes/extracts/common-option-comment.rst + * - comment + - mixed + - .. include:: /includes/extracts/common-option-comment.rst - * - name - - string - - Name of the search index to create. + * - name + - string + - | Name of the search index to create. + | You cannot create multiple indexes with the same name on a single + collection. If you do not specify a name, the index is named ``default``. - You cannot create multiple indexes with the same name on a single - collection. If you do not specify a name, the index is named "default". + * - type + - string + - Type of index to create. Accepted values are ``'search'`` and + ``'vectorSearch'``. If you omit this option, the default + value is ``'search'`` and the method creates an Atlas Search index. Return Values ------------- -The name of the created Atlas Search index as a string. +The name of the created Atlas Search or Vector Search index as a string. Errors/Exceptions ----------------- @@ -91,8 +95,8 @@ to index all document fields containing $collection = (new MongoDB\Client)->getCollection('test', 'articles'); $indexName = $collection->createSearchIndex( - ['mappings' => ['dynamic' => true]], - ['name' => 'test-search-index'] + ['mappings' => ['dynamic' => true]], + ['name' => 'test-search-index'] ); var_dump($indexName); @@ -110,6 +114,7 @@ See Also - :phpmethod:`MongoDB\Collection::dropSearchIndex()` - :phpmethod:`MongoDB\Collection::listSearchIndexes()` - :phpmethod:`MongoDB\Collection::updateSearchIndex()` +- :ref:`php-atlas-search-index` guide - :manual:`createSearchIndexes ` command reference in the MongoDB manual - `Atlas Search `__ documentation in the MongoDB Manual diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt index f9124f57..14ef8d66 100644 --- a/source/reference/method/MongoDBCollection-createSearchIndexes.txt +++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt @@ -16,7 +16,7 @@ Definition .. phpmethod:: MongoDB\Collection::createSearchIndexes() - Create one or more Atlas Search indexes for the collection. + Create one or more Atlas Search or Vector Search indexes for the collection. .. code-block:: php @@ -41,6 +41,10 @@ Parameters create. You cannot create multiple indexes with the same name on a single collection. If you do not specify a name, the index is named "default". + An optional ``type`` string field specifies the type of search index to + create. Accepted values are ``'search'`` and ``'vectorSearch'``. If + you do not specify a type, the method creates an Atlas Search index. + ``$options`` : array An array specifying the desired options. @@ -59,7 +63,8 @@ Parameters Return Values ------------- -The names of the created Atlas Search indexes as an array of strings. +The names of the created Atlas Search and Vector Search indexes as an +array of strings. Errors/Exceptions ----------------- @@ -117,6 +122,7 @@ See Also - :phpmethod:`MongoDB\Collection::dropSearchIndex()` - :phpmethod:`MongoDB\Collection::listSearchIndexes()` - :phpmethod:`MongoDB\Collection::updateSearchIndex()` +- :ref:`php-atlas-search-index` guide - :manual:`createSearchIndexes ` command reference in the MongoDB manual - `Atlas Search `__ documentation in the MongoDB Manual From cd6a5867e086bec78443a09780e2ec7ce4193391 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 7 Feb 2025 14:55:06 -0500 Subject: [PATCH 2/6] indentation fix --- .../MongoDBCollection-createSearchIndex.txt | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt index cf1580cc..f5acd0f3 100644 --- a/source/reference/method/MongoDBCollection-createSearchIndex.txt +++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt @@ -19,10 +19,10 @@ Definition .. code-block:: php - function createSearchIndex( - array|object $definition, - array $options = [] - ): string + function createSearchIndex( + array|object $definition, + array $options = [] + ): string .. include:: /includes/extracts/note-atlas-search-requirement.rst @@ -37,28 +37,28 @@ Parameters An array specifying the desired options. .. list-table:: - :header-rows: 1 - :widths: 20 20 80 + :header-rows: 1 + :widths: 20 20 80 - * - Name - - Type - - Description + * - Name + - Type + - Description - * - comment - - mixed - - .. include:: /includes/extracts/common-option-comment.rst + * - comment + - mixed + - .. include:: /includes/extracts/common-option-comment.rst - * - name - - string - - | Name of the search index to create. - | You cannot create multiple indexes with the same name on a single - collection. If you do not specify a name, the index is named ``default``. + * - name + - string + - | Name of the search index to create. + | You cannot create multiple indexes with the same name on a single + collection. If you do not specify a name, the index is named ``default``. - * - type - - string - - Type of index to create. Accepted values are ``'search'`` and - ``'vectorSearch'``. If you omit this option, the default - value is ``'search'`` and the method creates an Atlas Search index. + * - type + - string + - Type of index to create. Accepted values are ``'search'`` and + ``'vectorSearch'``. If you omit this option, the default + value is ``'search'`` and the method creates an Atlas Search index. Return Values ------------- @@ -95,8 +95,8 @@ to index all document fields containing $collection = (new MongoDB\Client)->getCollection('test', 'articles'); $indexName = $collection->createSearchIndex( - ['mappings' => ['dynamic' => true]], - ['name' => 'test-search-index'] + ['mappings' => ['dynamic' => true]], + ['name' => 'test-search-index'] ); var_dump($indexName); From 3b3ec37c252c1169cbbbfe677f27726c18bb14c4 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 7 Feb 2025 14:58:03 -0500 Subject: [PATCH 3/6] indentation fix --- source/includes/indexes/indexes.php | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/source/includes/indexes/indexes.php b/source/includes/indexes/indexes.php index f286125f..f7947e02 100644 --- a/source/includes/indexes/indexes.php +++ b/source/includes/indexes/indexes.php @@ -79,24 +79,24 @@ // start-create-multiple-indexes $indexNames = $collection->createSearchIndexes( - [ - [ - 'name' => 'SearchIdx', - 'definition' => ['mappings' => ['dynamic' => true]], - ], - [ - 'name' => 'VSidx', - 'type' => 'vectorSearch', - 'definition' => [ - 'fields' => [[ - 'type' => 'vector', - 'path' => 'plot_embedding', - 'numDimensions' => 1536, - 'similarity' => 'dotProduct' - ]] - ], - ], - ] + [ + [ + 'name' => 'SearchIdx', + 'definition' => ['mappings' => ['dynamic' => true]], + ], + [ + 'name' => 'VSidx', + 'type' => 'vectorSearch', + 'definition' => [ + 'fields' => [[ + 'type' => 'vector', + 'path' => 'plot_embedding', + 'numDimensions' => 1536, + 'similarity' => 'dotProduct' + ]] + ], + ], + ] ); // end-create-multiple-indexes From f8210307193c1a7c994e5519d576bb175288559d Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 7 Feb 2025 15:01:53 -0500 Subject: [PATCH 4/6] add whats new entry --- source/whats-new.txt | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/source/whats-new.txt b/source/whats-new.txt index 3b60fb17..fe7d85b8 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -38,13 +38,13 @@ What's New in 2.0 changes: - The following methods return ``void`` instead of the raw command - response: + response: - - ``MongoDB\Client``: ``dropDatabase()`` - - ``MongoDB\Collection``: ``drop()``, ``dropIndex()``, - ``dropIndexes()``, ``dropSearchIndex()``, ``rename()`` - - ``MongoDB\Database``: ``createCollection()``, ``drop()``, - ``dropCollection()``, ``renameCollection()`` + - ``MongoDB\Client``: ``dropDatabase()`` + - ``MongoDB\Collection``: ``drop()``, ``dropIndex()``, + ``dropIndexes()``, ``dropSearchIndex()``, ``rename()`` + - ``MongoDB\Database``: ``createCollection()``, ``drop()``, + ``dropCollection()``, ``renameCollection()`` To learn more about breaking changes in this release, see the :ref:`Version 2.0 Breaking Changes ` section @@ -67,14 +67,14 @@ and removals: - Removes deprecated fields in GridFS types. - The library does not calculate the ``md5`` field when a file is - uploaded to GridFS. If your application requires a file digest, you - must implement this process outside GridFS and store the values in - metadata. + uploaded to GridFS. If your application requires a file digest, you + must implement this process outside GridFS and store the values in + metadata. - The fields ``contentType`` and ``aliases`` are no longer stored in - the ``files`` GridFS collection. If your application requires this - information, you must store it in metadata. To learn more about - GridFS, see the :ref:`php-gridfs` guide. + the ``files`` GridFS collection. If your application requires this + information, you must store it in metadata. To learn more about + GridFS, see the :ref:`php-gridfs` guide. - Removes the following deprecated options for find operations: @@ -164,6 +164,13 @@ improvements, and fixes: encryption and decryption of the data key locally, ensuring that the encryption key never leaves the KMIP server. +- Adds the ``type`` option in Search index specifications for + the :phpmethod:`MongoDB\Collection::createIndex()` and + :phpmethod:`MongoDB\Collection::createSearchIndexes()` methods. This + change allows you to create Atlas Vector Search indexes + programmatically. To learn more and view examples, see the + :ref:`php-atlas-search-index` guide. + For more information about the changes in this version, see the :github:`v1.20 release notes ` on GitHub. From 198fea0d1197e563b11ba6e34210bb8acbe8e8ce Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 7 Feb 2025 15:02:07 -0500 Subject: [PATCH 5/6] indentation fix --- source/whats-new.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/whats-new.txt b/source/whats-new.txt index fe7d85b8..656ba387 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -38,13 +38,13 @@ What's New in 2.0 changes: - The following methods return ``void`` instead of the raw command - response: + response: - - ``MongoDB\Client``: ``dropDatabase()`` - - ``MongoDB\Collection``: ``drop()``, ``dropIndex()``, - ``dropIndexes()``, ``dropSearchIndex()``, ``rename()`` - - ``MongoDB\Database``: ``createCollection()``, ``drop()``, - ``dropCollection()``, ``renameCollection()`` + - ``MongoDB\Client``: ``dropDatabase()`` + - ``MongoDB\Collection``: ``drop()``, ``dropIndex()``, + ``dropIndexes()``, ``dropSearchIndex()``, ``rename()`` + - ``MongoDB\Database``: ``createCollection()``, ``drop()``, + ``dropCollection()``, ``renameCollection()`` To learn more about breaking changes in this release, see the :ref:`Version 2.0 Breaking Changes ` section @@ -67,14 +67,14 @@ and removals: - Removes deprecated fields in GridFS types. - The library does not calculate the ``md5`` field when a file is - uploaded to GridFS. If your application requires a file digest, you - must implement this process outside GridFS and store the values in - metadata. + uploaded to GridFS. If your application requires a file digest, you + must implement this process outside GridFS and store the values in + metadata. - The fields ``contentType`` and ``aliases`` are no longer stored in - the ``files`` GridFS collection. If your application requires this - information, you must store it in metadata. To learn more about - GridFS, see the :ref:`php-gridfs` guide. + the ``files`` GridFS collection. If your application requires this + information, you must store it in metadata. To learn more about + GridFS, see the :ref:`php-gridfs` guide. - Removes the following deprecated options for find operations: From 7d9bfe879947431e4212b411a3d0846f1cca8c9d Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Feb 2025 09:33:01 -0500 Subject: [PATCH 6/6] SA PR fixes 1 --- source/indexes.txt | 5 +++-- source/indexes/atlas-search-index.txt | 4 ++-- .../reference/method/MongoDBCollection-createSearchIndex.txt | 3 ++- .../method/MongoDBCollection-createSearchIndexes.txt | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/indexes.txt b/source/indexes.txt index 29afd6ed..dfe80727 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -229,9 +229,10 @@ Atlas Search Index Management ----------------------------- The following sections contain code examples that describe how to manage -:atlas:`Atlas Search indexes `. +:atlas:`Atlas Search ` and :atlas:`Vector +Search ` indexes. -.. note:: Atlas Search Index Management is Asynchronous +.. note:: Atlas Search and Vector Search Index Management is Asynchronous The {+php-library+} manages Atlas Search indexes asynchronously. The library methods described in the following sections return the server diff --git a/source/indexes/atlas-search-index.txt b/source/indexes/atlas-search-index.txt index 225bb44e..c3d8fce4 100644 --- a/source/indexes/atlas-search-index.txt +++ b/source/indexes/atlas-search-index.txt @@ -40,7 +40,7 @@ to manage your Atlas Search and Vector Search indexes: - ``MongoDB\Collection::updateSearchIndex()`` - ``MongoDB\Collection::dropSearchIndex()`` -.. note:: Search and Vector Search Index Management is Asynchronous +.. note:: Atlas Search and Vector Search Index Management is Asynchronous The {+php-library+} manages Atlas Search and Vector Search indexes asynchronously. The library methods described in the following @@ -77,7 +77,7 @@ Search index: :start-after: start-create-vector-index :end-before: end-create-vector-index -The following code example shows how to create Search and +The following code example shows how to create Atlas Search and Vector Search indexes in one call: .. literalinclude:: /includes/indexes/indexes.php diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt index f5acd0f3..a229a153 100644 --- a/source/reference/method/MongoDBCollection-createSearchIndex.txt +++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt @@ -52,7 +52,8 @@ Parameters - string - | Name of the search index to create. | You cannot create multiple indexes with the same name on a single - collection. If you do not specify a name, the index is named ``default``. + collection. If you do not specify a name, the default index + name is ``default``. * - type - string diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt index 14ef8d66..6c1b4981 100644 --- a/source/reference/method/MongoDBCollection-createSearchIndexes.txt +++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt @@ -39,7 +39,8 @@ Parameters An optional ``name`` string field specifies the name of the search index to create. You cannot create multiple indexes with the same name on a single - collection. If you do not specify a name, the index is named "default". + collection. If you do not specify a name, the default index name is + ``default``. An optional ``type`` string field specifies the type of search index to create. Accepted values are ``'search'`` and ``'vectorSearch'``. If