From b391ee52d2a9532a6f8bef3ecaf2b1f30c964872 Mon Sep 17 00:00:00 2001 From: cbullinger Date: Mon, 7 Oct 2024 09:05:37 -0400 Subject: [PATCH 1/2] Update Indexes page to clarify that vector search indexes require the plural create method --- source/fundamentals/indexes.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/fundamentals/indexes.txt b/source/fundamentals/indexes.txt index 179e44a2..197ce08f 100644 --- a/source/fundamentals/indexes.txt +++ b/source/fundamentals/indexes.txt @@ -241,7 +241,7 @@ embeddings stored in MongoDB Atlas. To learn more about Atlas Vector Search, see You can call the following methods on a collection to manage your Atlas Search and Vector Search indexes: -- ``createSearchIndex()`` +- ``createSearchIndex()`` *(valid for Search indexes only)* - ``createSearchIndexes()`` - ``listSearchIndexes()`` - ``updateSearchIndex()`` @@ -261,9 +261,16 @@ Create a Search Index +++++++++++++++++++++ You can use the `createSearchIndex() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-search-index.html>`__ -and `createSearchIndexes() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-search-indexes.html>`__ -methods to create Atlas Search and Vector Search indexes on a -collection. +method to create a single Atlas Search index. You *cannot* use this method to +create a Vector Search index. + +You can use the +`createSearchIndexes() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-search-indexes.html>`__ +method to create multiple Atlas Search indexes or one or more Vector Search +indexes. You must create and pass a +`SearchIndexModel +<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/SearchIndexModel.html>`__ +instance for each index. The following code example shows how to create an Atlas Search index: From 253eceeab6460eec8285bd55c5167e060dd9a102 Mon Sep 17 00:00:00 2001 From: cbullinger <115956901+cbullinger@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:26:50 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Rea Rustagi <85902999+rustagir@users.noreply.github.com> --- source/fundamentals/indexes.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/fundamentals/indexes.txt b/source/fundamentals/indexes.txt index f35910a2..c095a6dc 100644 --- a/source/fundamentals/indexes.txt +++ b/source/fundamentals/indexes.txt @@ -266,11 +266,11 @@ create a Vector Search index. You can use the `createSearchIndexes() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-search-indexes.html>`__ -method to create multiple Atlas Search indexes or one or more Vector Search -indexes. You must create and pass a +method to create multiple Atlas Search or Vector Search +indexes. You must create a `SearchIndexModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/SearchIndexModel.html>`__ -instance for each index. +instance for each index, then pass a list of ``SearchIndexModel`` instances to the ``createSearchIndexes()`` method. The following code example shows how to create an Atlas Search index: