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
`searchMeta() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#searchMeta(com.mongodb.client.model.search.SearchCollector)>`__.
124
+
125
+
SearchOperator Helper Methods
126
+
-----------------------------
127
+
128
+
To make building pipeline stages easier, the {+driver-short+} provides helper methods
129
+
for the following operations:
130
+
131
+
- :atlas:`autocomplete </atlas-search/autocomplete/>`: Performs a search for a
132
+
word or phrase that contains a sequence of characters from an incomplete
133
+
input string.
134
+
135
+
- :atlas:`compound </atlas-search/compound/>`: Combines two or more operators
136
+
into a single query.
137
+
138
+
- :atlas:`equals </atlas-search/equals/>` (``equals()`` and ``equalsNull()``): Checks
139
+
whether a field matches a value you specify.
140
+
141
+
- :atlas:`exists </atlas-search/exists/>`: Tests if a path to a specified
142
+
indexed field name exists in a document.
143
+
144
+
- :atlas:`in </atlas-search/in/>`: Performs a search for an array of BSON
145
+
number, date, boolean, objectId, uuid, or string values at the given path
146
+
and returns documents where the value of the field equals any value in the
147
+
specified array.
148
+
149
+
- :atlas:`moreLikeThis </atlas-search/moreLikeThis/>`: Returns documents similar
150
+
to input documents.
151
+
152
+
- :atlas:`near </atlas-search/near/>`: Supports querying and scoring numeric,
153
+
date, and GeoJSON point values.
154
+
155
+
- :atlas:`phrase </atlas-search/phrase/>`: Performs a search for documents
156
+
containing an ordered sequence of terms using the analyzer specified in the
157
+
index configuration.
158
+
159
+
- :atlas:`queryString </atlas-search/queryString/>`: Supports querying a
160
+
combination of indexed fields and values.
161
+
162
+
- :atlas:`range </atlas-search/range/>` (``numberRange()`` and ``dateRange()``): Supports
163
+
querying and scoring numeric, date, and string values.
164
+
165
+
- :atlas:`regex </atlas-search/regex/>`: Interprets the query field as a regular
166
+
expression.
167
+
168
+
- :atlas:`text </atlas-search/text/>`: Performs a full-text search using the
169
+
analyzer that you specify in the index configuration.
170
+
171
+
- :atlas:`wildcard </atlas-search/wildcard/>`: Enables queries which use special
172
+
characters in the search string that can match any character.
173
+
174
+
Example Pipeline Search Stage
175
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176
+
177
+
.. note:: Atlas Sample Dataset
178
+
179
+
This example uses the MongoDB Atlas sample dataset. Specifically, the
180
+
``movies`` collection in the ``sample_mflix`` database. You can learn how
181
+
to set up your own free-tier Atlas cluster and how to load the sample dataset
182
+
in our :ref:`quick start guide <java-get-started>`.
183
+
184
+
The following code creates a search stage for a pipeline with the following filters:
185
+
186
+
- Movies in the drama genre
187
+
- Movies that include Sylvester Stallone in the cast, accounting for possible misspellings
188
+
- Movies made between 1980 and 1989, inclusive
189
+
- Movies with titles that begin with the word ``"Rocky"``
To learn more about the helper methods, see the `SearchOperator Interface API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/SearchOperator.html>`__.
198
+
93
199
Additional Information
94
200
----------------------
95
201
@@ -105,3 +211,4 @@ the following API documentation:
`searchMeta() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#searchMeta(com.mongodb.client.model.search.SearchCollector)>`__.
933
+
To learn about building Atlas Search pipelines, see the :ref:`Atlas Search
934
+
<java-atlas-search>` and :ref:`Atlas Vector Search <java-atlas-vector-search>` pages.
0 commit comments