@@ -19,14 +19,14 @@ $text
1919
2020.. include:: /includes/extracts/fact-text-search-legacy-atlas.rst
2121
22- This page describes :query:` $text` operator for self-managed deployments.
22+ This page describes the `` $text` ` operator for self-managed deployments.
2323
2424Definition
2525----------
2626
2727.. query:: $text
2828
29- :query:` $text` performs a text search on the content of the fields
29+ `` $text` ` performs a text search on the content of the fields
3030 indexed with a :ref:`text index <index-type-text>`.
3131
3232Compatibility
@@ -39,7 +39,7 @@ Compatibility
3939Syntax
4040------
4141
42- A :query:` $text` expression has the following syntax:
42+ A `` $text` ` expression has the following syntax:
4343
4444.. code-block:: javascript
4545
@@ -52,7 +52,7 @@ A :query:`$text` expression has the following syntax:
5252 }
5353 }
5454
55- The :query:` $text` operator accepts a text query document with the
55+ The `` $text` ` operator accepts a text query document with the
5656following fields:
5757
5858.. |object-behavior| replace:: :ref:`text-query-operator-behavior`
@@ -107,7 +107,7 @@ following fields:
107107
108108 For more information, see :ref:`text-operator-diacritic-sensitivity`.
109109
110- The :query:` $text` operator, by default, does *not* return results
110+ The `` $text` ` operator, by default, does *not* return results
111111sorted in terms of the results' scores. For more information on
112112sorting by the text search scores, see the
113113:ref:`text-operator-text-score` documentation.
@@ -120,52 +120,52 @@ Behavior
120120Restrictions
121121~~~~~~~~~~~~
122122
123- - A query can specify, at most, one :query:` $text` expression.
123+ - A query can specify, at most, one `` $text` ` expression.
124124
125- - The :query:` $text` query can not appear in :query:`$nor` expressions.
125+ - The `` $text` ` query can not appear in :query:`$nor` expressions.
126126
127- - The :query:` $text` query can not appear in :query:`$elemMatch` query
127+ - The `` $text` ` query can not appear in :query:`$elemMatch` query
128128 expressions or :projection:`$elemMatch` projection expressions.
129129
130- - To use a :query:` $text` query in an :query:`$or` expression, all
130+ - To use a `` $text` ` query in an :query:`$or` expression, all
131131 clauses in the :query:`$or` array must be indexed.
132132
133133- .. include:: /includes/fact-hint-text-query-restriction.rst
134134
135135- .. include:: /includes/fact-natural-sort-order-text-query-restriction.rst
136136
137- .. |operation| replace:: :query:` $text` expression
137+ .. |operation| replace:: `` $text` ` expression
138138
139139- .. include:: /includes/fact-special-indexes-and-text.rst
140140
141141- .. include:: /includes/extracts/views-unsupported-text-search.rst
142142
143- - :query:` $text` is unsupported for creating indexes using the
143+ - `` $text` ` is unsupported for creating indexes using the
144144 :ref:`Stable API <stable-api>` V1.
145145
146- If using the :query:` $text` operator in aggregation, the following
146+ If using the `` $text` ` operator in aggregation, the following
147147restrictions also apply.
148148
149149.. include:: /includes/list-text-search-restrictions-in-agg.rst
150150
151- .. |text-object| replace:: :query:` $text`
151+ .. |text-object| replace:: `` $text` `
152152.. |meta-object| replace:: :expression:`$meta` projection operator
153153.. |sort-object| replace:: :method:`~cursor.sort()` method
154154
155155``$search`` Field
156156~~~~~~~~~~~~~~~~~
157157
158158In the ``$search`` field, specify a string of words that the
159- :query:` $text` operator parses and uses to query the :ref:`text index
159+ `` $text` ` operator parses and uses to query the :ref:`text index
160160<index-type-text>`.
161161
162- The :query:` $text` operator treats most punctuation
162+ The `` $text` ` operator treats most punctuation
163163in the string as delimiters, except a hyphen-minus (``-``) that negates term or
164164an escaped double quotes ``\"`` that specifies a phrase.
165165
166166.. note::
167167
168- The ``$search`` field for the :query:` $text` expression is different
168+ The ``$search`` field for the `` $text` ` expression is different
169169 than the :atlas:`$search aggregation stage
170170 </reference/atlas-search/query-syntax/>` provided by
171171 :atlas:`Atlas Search </atlas-search>`. The ``$search`` aggregation
@@ -192,7 +192,7 @@ For example, passed a ``$search`` string:
192192
193193 "\"ssl certificate\" authority key"
194194
195- The :query:` $text` operator searches for the phrase ``"ssl
195+ The `` $text` ` operator searches for the phrase ``"ssl
196196certificate"``.
197197
198198.. note::
@@ -213,12 +213,12 @@ Prefixing a word with a hyphen-minus (``-``) negates a word:
213213 search will not match any documents.
214214
215215- A hyphenated word, such as ``pre-market``, is not a negation. If used
216- in a hyphenated word, :query:` $text` operator treats the hyphen-minus
216+ in a hyphenated word, the `` $text` ` operator treats the hyphen-minus
217217 (``-``) as a delimiter. To negate the word ``market`` in this
218218 instance, include a space between ``pre`` and ``-market``, i.e.,
219219 ``pre -market``.
220220
221- The :query:` $text` operator adds all negations to the query with the
221+ The `` $text` ` operator adds all negations to the query with the
222222logical ``AND`` operator.
223223
224224Match Operation
@@ -227,7 +227,7 @@ Match Operation
227227Stop Words
228228``````````
229229
230- The :query:` $text` operator ignores language-specific stop words, such
230+ The `` $text` ` operator ignores language-specific stop words, such
231231as ``the`` and ``and`` in English.
232232
233233.. _match-operation-stemmed-words:
@@ -236,7 +236,7 @@ Stemmed Words
236236`````````````
237237
238238For case insensitive and diacritic insensitive text searches, the
239- :query:` $text` operator matches on the complete *stemmed* word. So if a
239+ `` $text` ` operator matches on the complete *stemmed* word. So if a
240240document field contains the word ``blueberry``, a search on the term
241241``blue`` will not match. However, ``blueberry`` or ``blueberries`` will
242242match.
@@ -248,7 +248,7 @@ Case Sensitive Search and Stemmed Words
248248
249249For :ref:`case sensitive <text-operator-case-sensitivity>` search (i.e.
250250``$caseSensitive: true``), if the suffix stem contains uppercase
251- letters, the :query:` $text` operator matches on the exact word.
251+ letters, the `` $text` ` operator matches on the exact word.
252252
253253.. _diacritic-sensitivity-and-stemming:
254254
@@ -257,15 +257,15 @@ Diacritic Sensitive Search and Stemmed Words
257257
258258For :ref:`diacritic sensitive <text-operator-diacritic-sensitivity>`
259259search (i.e. ``$diacriticSensitive: true``), if the suffix stem
260- contains the diacritic mark or marks, the :query:` $text` operator
260+ contains the diacritic mark or marks, the `` $text` ` operator
261261matches on the exact word.
262262
263263.. _text-operator-case-sensitivity:
264264
265265Case Insensitivity
266266~~~~~~~~~~~~~~~~~~
267267
268- The :query:` $text` operator defaults to the case insensitivity of the
268+ The `` $text` ` operator defaults to the case insensitivity of the
269269:ref:`text <index-type-text>` index:
270270
271271- The version 3 :ref:`text index <text-index-case-insensitivity>` is
@@ -286,19 +286,19 @@ Case Sensitive Search Process
286286`````````````````````````````
287287
288288When performing a case sensitive search (``$caseSensitive: true``)
289- where the ``text`` index is case insensitive, the :query:` $text`
289+ where the ``text`` index is case insensitive, the `` $text` `
290290operator:
291291
292292- First searches the ``text`` index for case insensitive and diacritic
293293 matches.
294294
295295- Then, to return just the documents that match the case of the search
296- terms, the :query:` $text` query operation includes an additional
296+ terms, the `` $text` ` query operation includes an additional
297297 stage to filter out the documents that do not match the specified
298298 case.
299299
300300For case sensitive search (i.e. ``$caseSensitive: true``), if
301- the suffix stem contains uppercase letters, the :query:` $text` operator
301+ the suffix stem contains uppercase letters, the `` $text` ` operator
302302matches on the exact word.
303303
304304Specifying ``$caseSensitive: true`` may impact performance.
@@ -312,7 +312,7 @@ Specifying ``$caseSensitive: true`` may impact performance.
312312Diacritic Insensitivity
313313~~~~~~~~~~~~~~~~~~~~~~~
314314
315- The :query:` $text` operator defaults to the diacritic insensitivity of
315+ The `` $text` ` operator defaults to the diacritic insensitivity of
316316the :ref:`text <index-type-text>` index:
317317
318318- The version 3 :ref:`text index <text-index-diacritic-insensitivity>` is
@@ -330,30 +330,30 @@ specify ``$diacriticSensitive: true``.
330330
331331Text searches against earlier versions of the ``text`` index are
332332inherently diacritic sensitive and cannot be diacritic insensitive. As
333- such, the ``$diacriticSensitive`` option for the :query:` $text`
333+ such, the ``$diacriticSensitive`` option for the `` $text` `
334334operator has no effect with earlier versions of the ``text`` index.
335335
336336Diacritic Sensitive Search Process
337337``````````````````````````````````
338338
339339To perform a diacritic sensitive text search (``$diacriticSensitive:
340- true``) against a version 3 ``text`` index, the :query:` $text` operator:
340+ true``) against a version 3 ``text`` index, the `` $text` ` operator:
341341
342342- First searches the ``text`` index, which is diacritic insensitive.
343343
344344- Then, to return just the documents that match the diacritic marked
345- characters of the search terms, the :query:` $text` query operation
345+ characters of the search terms, the `` $text` ` query operation
346346 includes an additional stage to filter out the documents that do not
347347 match.
348348
349349Specifying ``$diacriticSensitive: true`` may impact performance.
350350
351351To perform a diacritic sensitive search against an earlier version of
352- the ``text`` index, the :query:` $text` operator searches the ``text``
352+ the ``text`` index, the `` $text` ` operator searches the ``text``
353353index, which is diacritic sensitive.
354354
355355For diacritic sensitive search, if the suffix stem contains the
356- diacritic mark or marks, the :query:` $text` operator matches on the
356+ diacritic mark or marks, the `` $text` ` operator matches on the
357357exact word.
358358
359359.. seealso::
@@ -422,7 +422,7 @@ the word:
422422Match Any of the Search Terms
423423~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
424424
425- If the search string is a space-delimited string, :query:` $text`
425+ If the search string is a space-delimited string, the `` $text` `
426426operator performs a logical ``OR`` search on each term and returns
427427documents that contains any of the terms.
428428
@@ -496,7 +496,7 @@ Exclude Documents That Contain a Term
496496~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
497497
498498A *negated* term is a term that is prefixed by a minus sign ``-``. If
499- you negate a term, the :query:` $text` operator will exclude the
499+ you negate a term, the `` $text` ` operator will exclude the
500500documents that contain those terms from the results.
501501
502502The following example searches for documents that contain the words
@@ -522,7 +522,7 @@ The query returns the following documents:
522522Search a Different Language
523523~~~~~~~~~~~~~~~~~~~~~~~~~~~
524524
525- Use the optional ``$language`` field in the :query:` $text` expression
525+ Use the optional ``$language`` field in the `` $text` ` expression
526526to specify a language that determines the list of stop words and the
527527rules for the stemmer and tokenizer for the search string.
528528
@@ -544,7 +544,7 @@ The query returns the following documents:
544544 { "_id" : 5, "subject" : "Café Con Leche", "author" : "abc", "views" : 200 }
545545 { "_id" : 8, "subject" : "Cafe con Leche", "author" : "xyz", "views" : 10 }
546546
547- The :query:` $text` expression can also accept the language by name,
547+ The `` $text` ` expression can also accept the language by name,
548548``spanish``. See :ref:`text-search-languages` for the supported
549549languages.
550550
@@ -555,7 +555,7 @@ languages.
555555Case and Diacritic Insensitive Search
556556~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
557557
558- The :query:` $text` operator defers to the case and diacritic
558+ The `` $text` ` operator defers to the case and diacritic
559559insensitivity of the ``text`` index. The version 3 ``text`` index is
560560diacritic insensitive and expands its case insensitivity to include the
561561Cyrillic alphabet as well as characters with diacritics. For details,
@@ -645,7 +645,7 @@ Case Sensitivity with Negated Term
645645``````````````````````````````````
646646
647647A *negated* term is a term that is prefixed by a minus sign ``-``. If
648- you negate a term, the :query:` $text` operator will exclude the
648+ you negate a term, the `` $text` ` operator will exclude the
649649documents that contain those terms from the results. You can also
650650specify case sensitivity for negated terms.
651651
@@ -703,7 +703,7 @@ Diacritic Sensitivity with Negated Term
703703
704704The ``$diacriticSensitive`` option applies also to negated terms. A
705705negated term is a term that is prefixed by a minus sign ``-``. If you
706- negate a term, the :query:` $text` operator will exclude the documents that
706+ negate a term, the `` $text` ` operator will exclude the documents that
707707contain those terms from the results.
708708
709709The following query performs a diacritic sensitive text search for
0 commit comments