diff --git a/source/includes/extracts-agg-stages.yaml b/source/includes/extracts-agg-stages.yaml index 9ac0d733e8a..762b6ec00c4 100644 --- a/source/includes/extracts-agg-stages.yaml +++ b/source/includes/extracts-agg-stages.yaml @@ -165,6 +165,17 @@ content: | - Randomly selects the specified number of documents from its input. + * - :pipeline:`$search` + + - Performs a full-text search of the field or fields in an + :atlas:`Atlas ` + collection. + + .. note:: + + ``$search`` is only available for MongoDB Atlas clusters, + and is not available for self-managed deployments. + * - :pipeline:`$set` - Adds new fields to documents. Similar to diff --git a/source/reference/operator/aggregation-pipeline.txt b/source/reference/operator/aggregation-pipeline.txt index 5c91adca3d9..ea1475b4356 100644 --- a/source/reference/operator/aggregation-pipeline.txt +++ b/source/reference/operator/aggregation-pipeline.txt @@ -242,6 +242,17 @@ Alphabetical Listing of Stages - Randomly selects the specified number of documents from its input. + * - :doc:`$search ` + + - Performs a full-text search of the field or fields in an Atlas + collection. + + .. note:: + + ``$search`` is only available for MongoDB Atlas clusters, and + is not available for self-managed deployments. + + * - :pipeline:`$set` - Adds new fields to documents. Outputs documents that @@ -320,6 +331,7 @@ Alphabetical Listing of Stages /reference/operator/aggregation/replaceRoot /reference/operator/aggregation/replaceWith /reference/operator/aggregation/sample + /reference/operator/aggregation/search /reference/operator/aggregation/set /reference/operator/aggregation/skip /reference/operator/aggregation/sort diff --git a/source/reference/operator/aggregation/search.txt b/source/reference/operator/aggregation/search.txt new file mode 100644 index 00000000000..b92716f3c01 --- /dev/null +++ b/source/reference/operator/aggregation/search.txt @@ -0,0 +1,26 @@ +===================== +$search (aggregation) +===================== + +.. default-domain:: mongodb + +``$search`` aggregation pipleline stage performs a full-text search of +the field or fields in an Atlas collection. The fields must be covered +by an :atlas:`Atlas Search +` index. See: + +- :atlas:`Atlas Search Index + ` to learn more about + creating and managing Atlas Search indexes. +- :atlas:`$search Aggregation Pipeline Stage` to learn more about the + ``$search`` pipeline stage syntax and usage. +- :atlas:`$search Operators ` to + learn more about the ``$search`` aggregation pipeline stage + operators. + +.. important:: + + The ``$search`` aggregation pipeline stage is only available for + collections hosted on :atlas:`MongoDB Atlas ` cluster tiers + running MongoDB version 4.2 or later. To learn more, see + :atlas:`Atlas Search `.