11.. _pymongo-atlas-search-index:
22
3- ====================
4- Atlas Search Indexes
5- ====================
3+ ======================================
4+ Atlas Search and Vector Search Indexes
5+ ======================================
66
77.. contents:: On this page
88 :local:
@@ -20,16 +20,23 @@ Atlas Search Indexes
2020Overview
2121--------
2222
23- The Atlas Search feature enables you to perform full-text searches on
24- collections hosted on MongoDB Atlas. The indexes specify the behavior of
23+ You can manage your :atlas:`Atlas Search </atlas-search>` and
24+ :atlas:`Atlas Vector Search </atlas-vector-search/vector-search-overview/>`
25+ indexes by using {+driver-short+}. The indexes specify the behavior of
2526the search and which fields to index.
2627
27- To learn more about MongoDB Atlas Search, see the
28- :atlas:`Atlas Search Indexes </atlas-search/atlas-search-overview/>`
29- documentation.
28+ Atlas Search enables you to perform full-text searches on
29+ collections hosted on MongoDB Atlas. Atlas Search indexes specify the behavior of
30+ the search and which fields to index.
31+
32+ Atlas Vector Search enables you to perform semantic searches on vector
33+ embeddings stored in MongoDB Atlas. Vector Search indexes define the
34+ indexes for the vector embeddings that you want to query and the boolean,
35+ date, objectId, numeric, string, or UUID values that you want to use to
36+ pre-filter your data.
3037
3138You can call the following methods on a collection to manage your Atlas Search
32- indexes:
39+ and Vector Search indexes:
3340
3441- ``create_search_index()``
3542- ``create_search_indexes()``
@@ -55,16 +62,31 @@ Create a Search Index
5562You can use the `create_search_index() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.create_search_index>`__
5663and the
5764`create_search_indexes() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.create_search_indexes>`__
58- methods to create Atlas Search indexes.
65+ methods to create Atlas Search indexes or Atlas Vector Search indexes .
5966
60- The following code example shows how to create a single index:
67+ The following code example shows how to create a single Atlas Search index:
6168
6269.. literalinclude:: /includes/indexes/indexes.py
6370 :language: python
6471 :start-after: start-create-search-index
6572 :end-before: end-create-search-index
6673
67- The following code example shows how to create multiple indexes:
74+ The following code example shows how to create a single Atlas Vector Search index
75+ by using the `SearchIndexModel <{+api-root+}pymongo/operations.html#pymongo.operations.SearchIndexModel>`__
76+ object:
77+
78+ .. literalinclude:: /includes/indexes/indexes.py
79+ :language: python
80+ :start-after: start-create-vector-search-index
81+ :end-before: end-create-vector-search-index
82+
83+ You can use the `create_search_indexes() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.create_search_indexes>`__
84+ method to create multiple indexes. These indexes can be Atlas Search or
85+ Vector Search indexes. The ``create_search_indexes()`` method takes a list of
86+ ``SearchIndexModel`` objects that correspond to each index you want to create.
87+
88+ The following code example shows how to create an Atlas Search index and an Atlas
89+ Vector Search index:
6890
6991.. literalinclude:: /includes/indexes/indexes.py
7092 :language: python
@@ -78,7 +100,8 @@ List Search Indexes
78100
79101You can use the
80102`list_search_indexes() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.list_search_indexes>`__
81- method to return the Atlas Search indexes of a collection.
103+ method to get information about the Atlas Search and Vector Search indexes
104+ of a collection.
82105
83106The following code example shows how to print a list of the search indexes of
84107a collection:
@@ -96,24 +119,32 @@ Update a Search Index
96119
97120You can use the
98121`update_search_index() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.update_search_index>`__
99- method to update an Atlas Search index.
122+ method to update an Atlas Search or Vector Search index.
100123
101- The following code shows how to update a search index:
124+ The following code example shows how to update an Atlas Search index:
102125
103126.. literalinclude:: /includes/indexes/indexes.py
104127 :language: python
105128 :dedent:
106129 :start-after: start-update-search-indexes
107130 :end-before: end-update-search-indexes
108131
132+ The following code example shows how to update an Atlas Vector Search index:
133+
134+ .. literalinclude:: /includes/indexes/indexes.py
135+ :language: python
136+ :dedent:
137+ :start-after: start-update-vector-search-indexes
138+ :end-before: end-update-vector-search-indexes
139+
109140.. _pymongo-atlas-search-index-drop:
110141
111142Delete a Search Index
112143---------------------
113144
114145You can use the
115146`drop_search_index() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.drop_search_index>`__
116- method to remove an Atlas Search index.
147+ method to remove an Atlas Search or Vector Search index.
117148
118149The following code shows how to delete a search index from a collection:
119150
0 commit comments