You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/atlas-search.txt
+25-16Lines changed: 25 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,12 @@ Atlas Search
20
20
Overview
21
21
--------
22
22
23
-
In this guide, you can learn how to query an Atlas Search index and use advanced search functionality for your applications. To query the seach index, use a ``$search`` aggregation pipeline stage with {+driver-short+}.
23
+
In this guide, you can learn how to query an Atlas Search index and use advanced search
24
+
functionality for your {+driver-short+} applications. You can query a search index by
25
+
using a ``$search`` aggregation pipeline stage.
24
26
25
-
To learn more about the ``$search`` pipeline stage, see :manual:`$search
26
-
</reference/operator/aggregation/search/>`.
27
+
To learn more about the ``$search`` pipeline stage, see the :manual:`$search
28
+
</reference/operator/aggregation/search/>` guide in the {+mdb-server+} manual.
27
29
28
30
.. note:: Only Available on Atlas for MongoDB v4.2 and Later
29
31
@@ -47,20 +49,26 @@ Create an Atlas Search Index
47
49
Before you can perform a search on an Atlas collection, you must first create an **Atlas
48
50
Search index** on the collection. An Atlas Search index is a data structure that
49
51
categorizes data in a searchable format. To learn how to create an Atlas Search Index
50
-
see the :ref:`pymongo-atlas-search-index` documentation.
52
+
see :ref:`pymongo-atlas-search-index`.
51
53
52
54
Search Your Data
53
55
----------------
54
56
55
-
To use the ``$search`` aggregation pipeline stage, you must select an Atlas Search query operator that specifies the type of query you run. You can also optionally select a collector that groups results by values or ranges. To see a table of all the operators and collectors available in Atlas Search, see :atlas:`Use Operators and Collectors in Atlas Search Queries </atlas-search/operators-and-collectors>`.
57
+
To use the ``$search`` aggregation pipeline stage, you must specify an Atlas Search query
58
+
operator that indicates the type of query you want to run. You can also optionally specify
59
+
a collector that groups results by values or ranges. To view a table of all the operators
60
+
and collectors available with Atlas Search, see :atlas:`Use Operators and Collectors in
The following example uses the ``phrase`` operator, which performs search for documents containing an ordered sequence of terms. To learn more about the ``phrase`` operator, see :atlas:`Phrase </atlas-search/phrase>` in the Atlas guide.
63
+
The following example uses the ``phrase`` operator, which performs a search for documents
64
+
that contain an ordered sequence of terms. To learn more about the ``phrase`` operator, see
65
+
:atlas:`Phrase </atlas-search/phrase>` in the Atlas guide.
58
66
59
-
The example performs a basic search of the ``title`` field for the query string ``new york``.
60
-
The query also includes a:
67
+
The example performs a basic search of the ``title`` field for the query string ``"new york"``.
68
+
The query also includes the following stages:
61
69
62
-
- :pipeline:`$limit` stage to limit the output to 10 results.
63
-
- :pipeline:`$project` stage to exclude all fields except
70
+
- :pipeline:`$limit`, to limit the output to 10 results.
71
+
- :pipeline:`$project`, to exclude all fields except
64
72
``title`` and add a field named ``score``.
65
73
66
74
.. io-code-block::
@@ -108,11 +116,12 @@ The query also includes a:
108
116
{ title: 'Naked in New York', score: 4.719893455505371 }
109
117
{ title: 'Autumn in New York', score: 4.719893455505371 }
110
118
111
-
Next Steps
112
-
----------
119
+
Additional Information
120
+
----------------------
113
121
114
-
Now that you've run a query using Atlas Search, review the Atlas Search :atlas:`documentation
115
-
</atlas-search>` to learn more about the different :atlas:`operators
116
-
</atlas-search/operators-and-collectors>` and other queries you can run. More query examples using
117
-
MongoDB Query Language (MQL) are available througout the Atlas :atlas:`documentation
122
+
To learn more about the different Atlas Search :atlas:`operators
123
+
</atlas-search/operators-and-collectors>` and other queries you can run, see the
0 commit comments