@@ -39,7 +39,7 @@ Run an Atlas Search Query
39
39
-------------------------
40
40
41
41
This section shows how to create an aggregation pipeline to run an
42
- Atlas Search on a collection. You can use the ``Aggregates.search()`` builder
42
+ Atlas Search query on a collection. You can use the ``Aggregates.search()`` builder
43
43
method to create a ``$search`` pipeline stage, which specifies the search
44
44
criteria. Then, call the ``aggregate()`` method and pass your pipeline as a parameter.
45
45
@@ -55,13 +55,17 @@ index, see the :ref:`java-search-indexes` section in the Indexes guide.
55
55
Atlas Search Example
56
56
~~~~~~~~~~~~~~~~~~~~
57
57
58
- This example performs an Atlas Search query by calling the
59
- ``aggregate()`` method and passing the following pipeline stage
60
- builders:
58
+ This example runs an Atlas Search query by performing the
59
+ following actions:
61
60
62
- - ``Aggregates.search()``: Specifies a search query for documents in which
63
- the ``title`` field contains the word ``"Alabama"``
64
- - ``Aggregates.project()``: Projects the ``title`` field of each matching document
61
+ - Constructs a ``$search`` stage by using the ``Aggregates.search()`` builder method,
62
+ instructing the driver to query for documents in which the ``title``
63
+ field contains the word ``"Alabama"``
64
+
65
+ - Constructs a ``$project`` stage by using the ``Aggregates.project()`` builder method,
66
+ instructing the driver to include the ``title`` field in the query results
67
+
68
+ - Passes the pipeline stages to the ``aggregate()`` method and prints the results
65
69
66
70
.. io-code-block::
67
71
:copyable:
0 commit comments