Skip to content

Commit 8220fcb

Browse files
committed
Add a note about the required index for $search and $vectorSearch stages
1 parent 7a85038 commit 8220fcb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/en/reference/aggregation-stage-reference.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,11 @@ number of available operators, please refer to the
694694
`MongoDB documentation <https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#-search>`_
695695
for a reference of all available operators.
696696

697+
.. note::
698+
A `Search index <https://www.mongodb.com/docs/atlas/atlas-search/>`_
699+
is required for this stage. See the `#[SearchIndex] attribute </reference/attributes.html#search_index>`_
700+
for details on how to define it.
701+
697702
.. code-block:: php
698703
699704
<?php
@@ -795,8 +800,12 @@ $vectorSearch
795800

796801
The ``$vectorSearch`` stage performs a vector similarity search on the specified
797802
field or fields which must be covered by an Atlas Vector Search index.
798-
This stage is only available when using MongoDB Atlas. ``$vectorSearch`` must be
799-
the first stage in the aggregation pipeline.
803+
``$vectorSearch`` must be the first stage in the aggregation pipeline.
804+
805+
.. note::
806+
A `Search index <https://www.mongodb.com/docs/atlas/atlas-search/>`_
807+
is required for this stage. See the `#[VectorSearchIndex] attribute </reference/attributes.html#vector_search_index>`_
808+
for details on how to define it.
800809

801810
.. code-block:: php
802811

0 commit comments

Comments
 (0)