Skip to content

Commit e38e26e

Browse files
authored
DOCS-16189 Phrase Text Search Limitations (#5137) (#5151)
* DOCS-16189 Phrase Text Search Limitations * copy edits * IF feedback
1 parent 9914f48 commit e38e26e

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

source/core/index-text.txt

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

256256
.. include:: /includes/fact-hint-text-query-restriction.rst
257257

258+
Text Search and Phrases
259+
-----------------------
260+
261+
.. include:: /includes/fact-text-search-phrase-and-term.rst
262+
263+
.. include:: /includes/fact-text-search-multiple-phrases.rst
264+
258265
.. _text-index-and-sort:
259266

260267
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
@@ -63,8 +63,8 @@ following fields:
6363
- string
6464
- A string of terms that MongoDB parses and uses to query the text
6565
index. MongoDB performs a logical ``OR`` search of the terms unless
66-
specified as a phrase. See |object-behavior| for more information on
67-
the field.
66+
specified as a :ref:`phrase <text-operator-phrases>`. For more
67+
information on the field, see |object-behavior|.
6868

6969
* - ``$language``
7070
- string
@@ -174,8 +174,7 @@ phrase in escaped double quotes (``\"``), as in:
174174

175175
"\"ssl certificate\""
176176

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

180179
For example, passed a ``$search`` string:
181180

@@ -186,6 +185,10 @@ For example, passed a ``$search`` string:
186185
The :query:`$text` operator searches for the phrase ``"ssl
187186
certificate"``.
188187

188+
.. note::
189+
190+
.. include:: /includes/fact-text-search-multiple-phrases.rst
191+
189192
.. _text-operator-term-negation:
190193

191194
Negations

0 commit comments

Comments
 (0)