Skip to content

Commit 5af3705

Browse files
authored
DOCS-16189 Phrase Text Search Limitations (#5137) (#5152)
* DOCS-16189 Phrase Text Search Limitations * copy edits * IF feedback
1 parent 35fba47 commit 5af3705

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
@@ -253,6 +253,13 @@ Text Search and Hints
253253

254254
.. include:: /includes/fact-hint-text-query-restriction.rst
255255

256+
Text Search and Phrases
257+
-----------------------
258+
259+
.. include:: /includes/fact-text-search-phrase-and-term.rst
260+
261+
.. include:: /includes/fact-text-search-multiple-phrases.rst
262+
256263
.. _text-index-and-sort:
257264

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

6565
* - ``$language``
6666
- string
@@ -167,8 +167,7 @@ phrase in escaped double quotes (``\"``), as in:
167167

168168
"\"ssl certificate\""
169169

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

173172
For example, passed a ``$search`` string:
174173

@@ -179,6 +178,10 @@ For example, passed a ``$search`` string:
179178
The :query:`$text` operator searches for the phrase ``"ssl
180179
certificate"``.
181180

181+
.. note::
182+
183+
.. include:: /includes/fact-text-search-multiple-phrases.rst
184+
182185
.. _text-operator-term-negation:
183186

184187
Negations

0 commit comments

Comments
 (0)