@@ -20,41 +20,46 @@ Atlas Search Indexes
20
20
Overview
21
21
--------
22
22
23
- The MongoDB Atlas Search feature enables you to perform full-text
24
- searches on collections hosted on Atlas. Before you can perform Atlas
25
- Search queries, you must create indexes that specify which
26
- fields to index and how they are indexed.
23
+ In this guide, you can learn how to programmatically manage your Atlas
24
+ Search and Atlas Vector Search indexes by using the {+library-short+}.
27
25
28
- To learn more about Atlas Search, see the :atlas:`Atlas Search Overview
29
- </atlas-search/atlas-search-overview/>`.
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
+
30
+ Atlas Vector Search enables you to perform semantic searches on vector
31
+ embeddings stored in MongoDB Atlas. To learn more about Atlas Vector Search,
32
+ see the :atlas:`Atlas Vector Search Overview </atlas-vector-search/vector-search-overview/>`.
30
33
31
34
You can use the following methods on a ``MongoDB\Collection`` instance
32
- to manage your Atlas Search indexes:
35
+ to manage your Atlas Search and Vector Search indexes:
33
36
34
37
- ``MongoDB\Collection::createSearchIndex()``
35
38
- ``MongoDB\Collection::createSearchIndexes()``
36
39
- ``MongoDB\Collection::listSearchIndexes()``
37
40
- ``MongoDB\Collection::updateSearchIndex()``
38
41
- ``MongoDB\Collection::dropSearchIndex()``
39
42
40
- .. note:: Atlas Search Index Management is Asynchronous
43
+ .. note:: Search and Vector Search Index Management is Asynchronous
41
44
42
- The {+php-library+} manages Atlas Search indexes asynchronously. The
43
- library methods described in the following sections return the server
44
- response immediately, but the changes to your Search indexes take
45
- place in the background and might not complete until some time later.
45
+ The {+php-library+} manages Atlas Search and Vector Search indexes
46
+ asynchronously. The library methods described in the following
47
+ sections return the server response immediately, but the changes to
48
+ your Search indexes take place in the background and might not
49
+ complete until some time later.
46
50
47
51
The following sections provide code examples that demonstrate how to use
48
- each Atlas Search index management method .
52
+ each of the preceding methods .
49
53
50
54
.. _php-atlas-search-index-create:
51
55
52
56
Create a Search Index
53
57
---------------------
54
58
55
59
You can use the ``createSearchIndex()`` method to create a single Atlas
56
- Search index on a collection, or the ``createSearchIndexes()`` method to
57
- create multiple indexes simultaneously.
60
+ Search or Vector Search index on a collection, or the
61
+ ``createSearchIndexes()`` method to create multiple indexes
62
+ simultaneously.
58
63
59
64
The following code example shows how to create a single Atlas Search
60
65
index:
@@ -64,25 +69,38 @@ index:
64
69
:start-after: start-create-search-index
65
70
:end-before: end-create-search-index
66
71
67
- The following code example shows how to create multiple Atlas Search
68
- indexes:
72
+ The following code example shows how to create a single Atlas Vector
73
+ Search index:
74
+
75
+ .. literalinclude:: /includes/indexes/indexes.php
76
+ :language: php
77
+ :start-after: start-create-vector-index
78
+ :end-before: end-create-vector-index
79
+
80
+ The following code example shows how to create Search and
81
+ Vector Search indexes in one call:
69
82
70
83
.. literalinclude:: /includes/indexes/indexes.php
71
84
:language: php
72
- :start-after: start-create-search-indexes
73
- :end-before: end-create-search-indexes
85
+ :start-after: start-create-multiple-indexes
86
+ :end-before: end-create-multiple-indexes
87
+
88
+ After you create Atlas Search or Atlas Vector Search indexes, you can
89
+ perform the corresponding query types on your documents.
74
90
75
- After you create a Search index, you can perform Atlas Search queries on
76
- your collection. To learn more, see :atlas:`Create and Run Atlas Search
77
- Queries </atlas-search/searching/>` in the Atlas documentation.
91
+ ..
92
+ TODO uncomment when https://github.com/mongodb/docs-php-library/pull/197 is merged
93
+ To learn more, see the following guides:
94
+ - :ref:`php-atlas-search`
95
+ - :ref:`php-vector-search`
78
96
79
97
.. _php-atlas-search-index-list:
80
98
81
99
List Search Indexes
82
100
-------------------
83
101
84
102
You can use the ``listSearchIndexes()`` method to return an array of the
85
- Atlas Search indexes on a collection:
103
+ Atlas Search and Vector Search indexes on a collection:
86
104
87
105
.. literalinclude:: /includes/indexes/indexes.php
88
106
:language: php
@@ -96,9 +114,8 @@ Update a Search Index
96
114
---------------------
97
115
98
116
You can use the ``updateSearchIndex()``
99
- method to update an Atlas Search index. You can use this method to
100
- change the name of a Search index or change the configuration of the
101
- index.
117
+ method to update an Atlas Search or Vector Search index. You can use this method to
118
+ change the name or configuration of an existing index.
102
119
103
120
The following code shows how to update a search index to use a simple
104
121
analyzer on the ``title`` field:
@@ -115,7 +132,7 @@ Delete a Search Index
115
132
---------------------
116
133
117
134
You can use the ``dropSearchIndex()`` method to remove an Atlas Search
118
- index from a collection.
135
+ or Vector Search index from a collection.
119
136
120
137
The following code shows how to delete the Atlas Search index named
121
138
``mySearchIdx``:
0 commit comments