@@ -62,16 +62,31 @@ Create a Search Index
62
62
You can use the `create_search_index() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.create_search_index>`__
63
63
and the
64
64
`create_search_indexes() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.create_search_indexes>`__
65
- methods to create Atlas Search indexes.
65
+ methods to create Atlas Search indexes or Atlas Vector Search indexes .
66
66
67
- 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:
68
68
69
69
.. literalinclude:: /includes/indexes/indexes.py
70
70
:language: python
71
71
:start-after: start-create-search-index
72
72
:end-before: end-create-search-index
73
73
74
- 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
+ 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 `create_search_indexes() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.create_search_indexes>`__
84
+ to create multiple indexes. These indexes can be Atlas Search indexes or Atlas
85
+ Vector Search indexes. ``create_search_indexes()`` requires the ``SearchIndexModel``
86
+ object.
87
+
88
+ The following code example shows how to create an Atlas Search index and Atlas
89
+ Vector Search index:
75
90
76
91
.. literalinclude:: /includes/indexes/indexes.py
77
92
:language: python
@@ -85,7 +100,8 @@ List Search Indexes
85
100
86
101
You can use the
87
102
`list_search_indexes() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.list_search_indexes>`__
88
- method to return the Atlas Search indexes of a collection.
103
+ method to return the Atlas Search indexes and Atlas Vector Search indexes
104
+ of a collection.
89
105
90
106
The following code example shows how to print a list of the search indexes of
91
107
a collection:
@@ -103,24 +119,32 @@ Update a Search Index
103
119
104
120
You can use the
105
121
`update_search_index() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.update_search_index>`__
106
- method to update an Atlas Search index.
122
+ method to update an Atlas Search index or Atlas Vector Search index .
107
123
108
- The following code shows how to update a search index:
124
+ The following code example shows how to update an Atlas Search index:
109
125
110
126
.. literalinclude:: /includes/indexes/indexes.py
111
127
:language: python
112
128
:dedent:
113
129
:start-after: start-update-search-indexes
114
130
:end-before: end-update-search-indexes
115
131
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
+
116
140
.. _pymongo-atlas-search-index-drop:
117
141
118
142
Delete a Search Index
119
143
---------------------
120
144
121
145
You can use the
122
146
`drop_search_index() <{+api-root+}pymongo/collection.html#pymongo.collection.Collection.drop_search_index>`__
123
- method to remove an Atlas Search index.
147
+ method to remove an Atlas Search index or Atlas Vector Search index .
124
148
125
149
The following code shows how to delete a search index from a collection:
126
150
0 commit comments