Skip to content

Commit 1b1bcc9

Browse files
authored
DOCS-16189 Phrase Text Search Limitations (#5137)
* DOCS-16189 Phrase Text Search Limitations * copy edits * IF feedback
1 parent 7a70c01 commit 1b1bcc9

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

source/core/indexes/index-types/index-text/text-index-restrictions.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ Text Search and Hints
2424

2525
.. include:: /includes/fact-hint-text-query-restriction.rst
2626

27+
Text Search and Phrases
28+
-----------------------
29+
30+
.. include:: /includes/fact-text-search-phrase-and-term.rst
31+
32+
.. include:: /includes/fact-text-search-multiple-phrases.rst
33+
2734
.. _text-index-and-sort:
2835

2936
Text Index and Sort
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You cannot use the ``$text`` operator to search for multiple phrases.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
If the ``$search`` string of a :query:`$text` operation includes a phrase and
2+
individual terms, text search only matches the documents that include the
3+
phrase.

source/reference/operator/query/text.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ following fields:
7070
- string
7171
- A string of terms that MongoDB parses and uses to query the text
7272
index. MongoDB performs a logical ``OR`` search of the terms unless
73-
specified as a phrase. See |object-behavior| for more information on
74-
the field.
73+
specified as a :ref:`phrase <text-operator-phrases>`. For more
74+
information on the field, see |object-behavior|.
7575

7676
* - ``$language``
7777
- string
@@ -181,8 +181,7 @@ phrase in escaped double quotes (``\"``), as in:
181181

182182
"\"ssl certificate\""
183183

184-
If the ``$search`` string includes a phrase and individual terms, text
185-
search will only match the documents that include the phrase.
184+
.. include:: /includes/fact-text-search-phrase-and-term.rst
186185

187186
For example, passed a ``$search`` string:
188187

@@ -193,6 +192,10 @@ For example, passed a ``$search`` string:
193192
The :query:`$text` operator searches for the phrase ``"ssl
194193
certificate"``.
195194

195+
.. note::
196+
197+
.. include:: /includes/fact-text-search-multiple-phrases.rst
198+
196199
.. _text-operator-term-negation:
197200

198201
Negations

0 commit comments

Comments
 (0)