@@ -95,14 +95,14 @@ Definition
95
95
- boolean
96
96
97
97
- Optional. A boolean flag to enable or disable diacritic sensitive search
98
- against :doc:` version 3 text indexes </core/ index-text>`. Defaults to
98
+ against version 3 :ref:` text < index-feature- text>` indexes . Defaults to
99
99
``false``; i.e. the search defers to the diacritic insensitivity of
100
- the :doc:` text </core/index-text> ` index.
101
-
102
- Text searches against earlier versions of the text index are
100
+ the `` text` ` index.
101
+
102
+ Text searches against earlier versions of the `` text`` index are
103
103
inherently diacritic sensitive and cannot be diacritic insensitive.
104
104
As such, the ``$diacriticSensitive`` option has no effect with
105
- earlier versions of the text index.
105
+ earlier versions of the `` text`` index.
106
106
107
107
For more information, see :ref:`text-operator-diacritic-sensitivity`.
108
108
@@ -255,12 +255,10 @@ matches on the exact word.
255
255
Case Insensitivity
256
256
~~~~~~~~~~~~~~~~~~
257
257
258
- .. versionchanged:: 3.2
259
-
260
258
The :query:`$text` operator defaults to the case insensitivity of the
261
259
:doc:`text </core/index-text>` index:
262
260
263
- - The :ref:` version 3 text index <text-index-case-insensitivity>` is
261
+ - The version 3 :ref:` text index <text-index-case-insensitivity>` is
264
262
case insensitive for Latin characters with or without diacritics and
265
263
characters from non-Latin alphabets, such as the Cyrillic alphabet.
266
264
See :ref:`text <text-index-case-insensitivity>` index for details.
@@ -303,12 +301,10 @@ Specifying ``$caseSensitive: true`` may impact performance.
303
301
Diacritic Insensitivity
304
302
~~~~~~~~~~~~~~~~~~~~~~~
305
303
306
- .. versionchanged:: 3.2
307
-
308
304
The :query:`$text` operator defaults to the diacritic insensitivity of
309
305
the :doc:`text </core/index-text>` index:
310
306
311
- - The :ref:` version 3 text index <text-index-diacritic-insensitivity>` is
307
+ - The version 3 :ref:` text index <text-index-diacritic-insensitivity>` is
312
308
diacritic insensitive. That is, the index does not distinguish
313
309
between characters that contain diacritical marks and their
314
310
non-marked counterpart, such as ``é``, ``ê``, and ``e``.
@@ -318,11 +314,11 @@ the :doc:`text </core/index-text>` index:
318
314
``$diacriticSensitive`` Option
319
315
``````````````````````````````
320
316
321
- To support diacritic sensitive text search against the version 3
322
- ``text`` index, specify ``$diacriticSensitive: true``.
317
+ To support diacritic sensitive text search against the ``text`` index,
318
+ specify ``$diacriticSensitive: true``.
323
319
324
320
Text searches against earlier versions of the ``text`` index are
325
- inherently diacritic sensitive and cannot be diacritic insensitive. As
321
+ inherently diacritic sensitive and cannot be diacritic insensitive. As
326
322
such, the ``$diacriticSensitive`` option for the :query:`$text`
327
323
operator has no effect with earlier versions of the ``text`` index.
328
324
@@ -343,7 +339,7 @@ Specifying ``$diacriticSensitive: true`` may impact performance.
343
339
344
340
To perform a diacritic sensitive search against an earlier version of
345
341
the ``text`` index, the :query:`$text` operator searches the ``text``
346
- index which is diacritic sensitive.
342
+ index, which is diacritic sensitive.
347
343
348
344
For diacritic sensitive search, if the suffix stem contains the
349
345
diacritic mark or marks, the :query:`$text` operator matches on the
@@ -365,7 +361,7 @@ Examples
365
361
--------
366
362
367
363
The following examples assume a collection ``articles`` that has a
368
- :doc:` version 3 text </core/index-text>` index on the field ``subject``:
364
+ version 3 :doc:` text </core/index-text>` index on the field ``subject``:
369
365
370
366
.. code-block:: javascript
371
367
@@ -539,8 +535,6 @@ languages.
539
535
Case and Diacritic Insensitive Search
540
536
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
541
537
542
- .. versionchanged:: 3.2
543
-
544
538
The :query:`$text` operator defers to the case and diacritic
545
539
insensitivity of the ``text`` index. The version 3 ``text`` index is
546
540
diacritic insensitive and expands its case insensitivity to include the
@@ -584,7 +578,7 @@ Insensitivity <text-index-diacritic-insensitivity>`.
584
578
{ "_id" : 5, "subject" : "Café Con Leche", "author" : "abc", "views" : 200 }
585
579
{ "_id" : 8, "subject" : "Cafe con Leche", "author" : "xyz", "views" : 10 }
586
580
587
- With the previous versions of the ``text`` index, the query would not
581
+ With previous versions of the ``text`` index, the query would not
588
582
match any document.
589
583
590
584
.. seealso::
@@ -598,8 +592,6 @@ match any document.
598
592
Perform Case Sensitive Search
599
593
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
600
594
601
- .. versionchanged:: 3.2
602
-
603
595
To enable case sensitive search, specify ``$caseSensitive: true``.
604
596
Specifying ``$caseSensitive: true`` may impact performance.
605
597
@@ -674,9 +666,7 @@ The query matches the following document:
674
666
Diacritic Sensitive Search
675
667
~~~~~~~~~~~~~~~~~~~~~~~~~~
676
668
677
- .. versionchanged:: 3.2
678
-
679
- To enable diacritic sensitive search against a version 3 :doc:`text
669
+ To enable diacritic sensitive search against a version 3 :doc:`text
680
670
</core/index-text>` index, specify ``$diacriticSensitive: true``.
681
671
Specifying ``$diacriticSensitive: true`` may impact performance.
682
672
@@ -768,7 +758,7 @@ and sorts the results by the descending score:
768
758
{ $text: { $search: "coffee" } },
769
759
{ score: { $meta: "textScore" } }
770
760
).sort( { score: { $meta: "textScore" } } )
771
-
761
+
772
762
The query returns the matching documents sorted by descending score.
773
763
774
764
.. seealso:: :ref:`text-operator-text-score`
0 commit comments