@@ -20,26 +20,30 @@ Atlas Search Indexes
2020Overview
2121--------
2222
23- :atlas:`Atlas Search </atlas-search>` enables you to perform full-text searches on
24- collections hosted on MongoDB Atlas. Atlas Search indexes specify the behavior of
25- the search and which fields to index.
23+ In this guide, you can learn how to programmatically manage your Atlas
24+ Search and Atlas Vector Search indexes by using the {+driver-short+}.
25+
26+ The Atlas Search feature enables you to perform full-text searches on
27+ collections hosted on MongoDB Atlas. To learn more about Atlas Search,
28+ see the :atlas:`Atlas Search Overview </atlas-search/atlas-search-overview/>`
29+ in the Atlas documentation.
30+
31+ Atlas Vector Search enables you to perform semantic searches on vector
32+ embeddings stored in MongoDB Atlas. To learn more about Atlas Vector Search,
33+ see the :atlas:`Atlas Vector Search Overview </atlas-vector-search/vector-search-overview/>`
34+ in the Atlas documentation.
2635
2736The following sections provide code examples that demonstrate how to create, list, update,
28- and delete Atlas Search indexes.
37+ and delete Atlas Search and Vector Search indexes.
2938
3039.. _c-atlas-search-index-create:
3140
3241Create a Search Index
3342---------------------
3443
35- You can pass the ``createSearchIndexes`` command to the ``mongoc_collection_command_simple()``
36- function to create one or more Atlas Search indexes.
37-
38- You can also use this function to create Atlas Vector Search indexes.
39- Atlas Vector Search enables you to perform semantic searches on vector
40- embeddings stored in MongoDB Atlas. To learn more about this feature,
41- see the :atlas:`Atlas Vector Search Overview
42- </atlas-vector-search/vector-search-overview/>` in the Atlas documentation.
44+ To create an Atlas Search or Vector Search index, pass the ``createSearchIndexes``
45+ command to the ``mongoc_collection_command_simple()`` function. You can use this command
46+ to create one or multiple indexes.
4347
4448The following code example shows how to create an Atlas Search index:
4549
@@ -49,26 +53,37 @@ The following code example shows how to create an Atlas Search index:
4953 :end-before: end-create-search-index
5054 :dedent:
5155
52- The following code example shows how to create multiple indexes:
56+ The following code example shows how to create an Atlas Vector Search index:
57+
58+ .. literalinclude:: /includes/indexes/indexes.c
59+ :language: c
60+ :start-after: start-create-vector-search-index
61+ :end-before: end-create-vector-search-index
62+ :dedent:
63+
64+ The following code example shows how to create both search indexes in
65+ one call to the ``mongoc_collection_command_simple()`` function:
5366
5467.. literalinclude:: /includes/indexes/indexes.c
5568 :language: c
5669 :start-after: start-create-search-indexes
5770 :end-before: end-create-search-indexes
5871 :dedent:
5972
60- To learn more about the syntax used to define Atlas Search indexes, see the
61- :atlas:`Review Atlas Search Index Syntax </atlas-search/index-definitions>` guide
62- in the Atlas documentation.
73+ To learn more about the syntax used to define each search index, see the
74+ following guides in the Atlas documentation:
75+
76+ - :atlas:`Review Atlas Search Index Syntax </atlas-search/index-definitions>`
77+ - :atlas:`How to Index Fields for Vector Search </atlas-vector-search/vector-search-type/>`
6378
6479.. _c-atlas-search-index-list:
6580
6681List Search Indexes
6782-------------------
6883
6984You can pass the ``$listSearchIndexes`` aggregation stage to the
70- ``mongoc_collection_aggregate()`` function to return all Atlas Search indexes in a
71- collection.
85+ ``mongoc_collection_aggregate()`` function to return all Atlas Search
86+ and Vector Search indexes in a collection.
7287
7388The following code example shows how to print a list of the search indexes in
7489a collection:
@@ -85,23 +100,35 @@ Update a Search Index
85100---------------------
86101
87102You can pass the ``updateSearchIndex`` command to the ``mongoc_collection_command_simple()``
88- function to update an Atlas Search index.
103+ function to update an Atlas Search or Vector Search index.
89104
90- The following code shows how to update a search index:
105+ The following code shows how to update the Atlas Search index
106+ created in the :ref:`c-atlas-search-index-create` section of this guide
107+ to use dynamic mappings:
91108
92109.. literalinclude:: /includes/indexes/indexes.c
93110 :language: c
94111 :start-after: start-update-search-index
95112 :end-before: end-update-search-index
96113 :dedent:
97114
115+ The following code shows how to update the Atlas Vector Search
116+ index created in the :ref:`c-atlas-search-index-create` section of this guide
117+ to use the ``cosine`` similarity function:
118+
119+ .. literalinclude:: /includes/indexes/indexes.c
120+ :language: c
121+ :start-after: start-update-vector-search-index
122+ :end-before: end-update-vector-search-index
123+ :dedent:
124+
98125.. _c-atlas-search-index-drop:
99126
100127Delete a Search Index
101128---------------------
102129
103130You can pass the ``dropSearchIndexes`` command to the ``mongoc_collection_command_simple()``
104- function to delete an Atlas Search index.
131+ function to delete an Atlas Search or Vector Search index.
105132
106133The following code shows how to delete a search index from a collection:
107134
@@ -114,8 +141,11 @@ The following code shows how to delete a search index from a collection:
114141Additional Information
115142----------------------
116143
117- To learn more about MongoDB Atlas Search, see the :atlas:`Atlas Search Indexes </atlas-search/atlas-search-overview/>`
118- documentation.
144+ To learn more about MongoDB Atlas Search, see :atlas:`Atlas Search Indexes </atlas-search/atlas-search-overview/>`
145+ in the Atlas documentation.
146+
147+ To learn more about MongoDB Atlas Vector Search, see :atlas:`How to Index Fields for Vector Search
148+ </atlas-vector-search/vector-search-type/>` in the Atlas documentation.
119149
120150API Documentation
121151~~~~~~~~~~~~~~~~~
0 commit comments