@@ -27,9 +27,9 @@ perform Atlas Vector Search queries by using the :ref:`Aggregation Builder API
27
27
28
28
.. note:: Deployment Compatibility
29
29
30
- You can use the Atlas Search feature only when
31
- you connect to MongoDB Atlas clusters. This feature is not
32
- available for self-managed deployments.
30
+ You can use the Atlas Search feature only when
31
+ you connect to MongoDB Atlas clusters. This feature is not
32
+ available for self-managed deployments.
33
33
34
34
To learn more about Atlas Vector Search, see the :atlas:`Overview
35
35
</atlas-vector-search/vector-search-overview/>` in the
@@ -82,11 +82,11 @@ queries:
82
82
.. code-block:: php
83
83
84
84
$pipeline = new Pipeline(
85
- Stage::vectorSearch(
86
- /* Atlas Vector Search query specifications
87
- index: '<index name>',
88
- path: '<path to embeddings>', ...*/
89
- ),
85
+ Stage::vectorSearch(
86
+ /* Atlas Vector Search query specifications
87
+ index: '<index name>',
88
+ path: '<path to embeddings>', ...*/
89
+ ),
90
90
);
91
91
92
92
You must pass the following parameters to the ``vectorSearch()`` method:
@@ -95,24 +95,24 @@ You must pass the following parameters to the ``vectorSearch()`` method:
95
95
:header-rows: 1
96
96
97
97
* - Parameter
98
- - Type
99
- - Description
98
+ - Type
99
+ - Description
100
100
101
101
* - ``index``
102
- - ``string``
103
- - Name of the vector search index
102
+ - ``string``
103
+ - Name of the vector search index
104
104
105
105
* - ``path``
106
- - ``array`` or ``string``
107
- - Field that stores vector embeddings
106
+ - ``array`` or ``string``
107
+ - Field that stores vector embeddings
108
108
109
109
* - ``queryVector``
110
- - ``array``
111
- - Vector representation of your query
110
+ - ``array``
111
+ - Vector representation of your query
112
112
113
113
* - ``limit``
114
- - ``int``
115
- - Number of results to return
114
+ - ``int``
115
+ - Number of results to return
116
116
117
117
Atlas Search Query Examples
118
118
---------------------------
@@ -123,7 +123,7 @@ section use sample data from the ``sample_mflix.embedded_movies``
123
123
collection.
124
124
125
125
.. note:: Query Vector Length
126
-
126
+
127
127
For demonstrative purposes, the examples in this section use
128
128
sample query vectors that contain very few elements, compared to
129
129
the query vector you might use in a runnable application. To view an
@@ -142,19 +142,19 @@ The following code performs an Atlas Vector Search query on the
142
142
:copyable: true
143
143
144
144
.. input:: /includes/aggregation/vector-search.php
145
- :language: php
146
- :dedent:
147
- :start-after: start-basic-query
148
- :end-before: end-basic-query
145
+ :language: php
146
+ :dedent:
147
+ :start-after: start-basic-query
148
+ :end-before: end-basic-query
149
149
150
150
.. output::
151
- :language: json
152
- :visible: false
151
+ :language: json
152
+ :visible: false
153
153
154
- {"title":"Thrill Seekers"}
155
- {"title":"About Time"}
156
- {"title":"Timecop"}
157
- // Results truncated
154
+ {"title":"Thrill Seekers"}
155
+ {"title":"About Time"}
156
+ {"title":"Timecop"}
157
+ // Results truncated
158
158
159
159
Vector Search Score
160
160
~~~~~~~~~~~~~~~~~~~
@@ -167,19 +167,19 @@ field, which describes how well the document matches the query vector:
167
167
:copyable: true
168
168
169
169
.. input:: /includes/aggregation/vector-search.php
170
- :language: php
171
- :dedent:
172
- :start-after: start-score-query
173
- :end-before: end-score-query
170
+ :language: php
171
+ :dedent:
172
+ :start-after: start-score-query
173
+ :end-before: end-score-query
174
174
175
175
.. output::
176
- :language: json
177
- :visible: false
176
+ :language: json
177
+ :visible: false
178
178
179
- {"title":"Thrill Seekers","score":0.927734375}
180
- {"title":"About Time","score":0.925750732421875}
181
- {"title":"Timecop","score":0.9241180419921875}
182
- // Results truncated
179
+ {"title":"Thrill Seekers","score":0.927734375}
180
+ {"title":"About Time","score":0.925750732421875}
181
+ {"title":"Timecop","score":0.9241180419921875}
182
+ // Results truncated
183
183
184
184
Vector Search Options
185
185
~~~~~~~~~~~~~~~~~~~~~
@@ -192,26 +192,26 @@ following optional parameters to ``vectorSearch()``:
192
192
:header-rows: 1
193
193
194
194
* - Optional Parameter
195
- - Type
196
- - Description
197
- - Default Value
195
+ - Type
196
+ - Description
197
+ - Default Value
198
198
199
199
* - ``exact``
200
- - ``bool``
201
- - Specifies whether to run an Exact Nearest Neighbor (``true``) or
202
- Approximate Nearest Neighbor (``false``) search
203
- - ``false``
200
+ - ``bool``
201
+ - Specifies whether to run an Exact Nearest Neighbor (``true``) or
202
+ Approximate Nearest Neighbor (``false``) search
203
+ - ``false``
204
204
205
205
* - ``filter``
206
- - ``QueryInterface`` or ``array``
207
- - Specifies a pre-filter for documents to search on
208
- - no filtering
206
+ - ``QueryInterface`` or ``array``
207
+ - Specifies a pre-filter for documents to search on
208
+ - no filtering
209
209
210
210
* - ``numCandidates``
211
- - ``int`` or ``null``
212
- - Specifies the number of nearest neighbors to use during the
213
- search
214
- - ``null``
211
+ - ``int`` or ``null``
212
+ - Specifies the number of nearest neighbors to use during the
213
+ search
214
+ - ``null``
215
215
216
216
To learn more about these parameters, see the :atlas:`Fields
217
217
</atlas-vector-search/vector-search-stage/#fields>` section of the
0 commit comments