Skip to content

Commit db57054

Browse files
stenniekay-kim
authored andcommitted
DOCS-10382: Clarify text search phrase matching behaviour
1 parent 640a373 commit db57054

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

source/text-search.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ Exact Phrase
5757
````````````
5858

5959
You can also search for exact phrases by wrapping them in double-quotes.
60-
For example, the following will find all documents containing "java" or
60+
If the ``$search`` string includes a phrase and individual terms, text search
61+
will only match documents that include the phrase.
62+
63+
For example, the following will find all documents containing
6164
"coffee shop":
6265

6366
.. code-block:: javascript
6467

65-
db.stores.find( { $text: { $search: "java \"coffee shop\"" } } )
68+
db.stores.find( { $text: { $search: "\"coffee shop\"" } } )
6669

6770
Term Exclusion
6871
``````````````

0 commit comments

Comments
 (0)