Skip to content

Commit 2315d78

Browse files
(DOCSP-27350): Update Atlas Search callouts - follow up (#2402)
* (DOCSP-27350): Update Atlas Search callouts - follow up (#2397) * (DOCSP-27350): Update Atlas Search callouts - follow up (#2336) * (DOCSP-27350): Update Atlas Search callouts - follow up * tweak language in include * more edits * tweak formatting in indexes overview * change page titles to use 'self managed' * remove note about view support * update regex intro * external review feedback * formatting * fix build warnings * fix text-search toc * add missing aggregation ref * fix include name
1 parent 2fd6b3b commit 2315d78

File tree

11 files changed

+119
-109
lines changed

11 files changed

+119
-109
lines changed

source/aggregation.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _aggregation:
2+
13
===========
24
Aggregation
35
===========

source/core/index-text.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Text Indexes
1212
:depth: 1
1313
:class: singlecol
1414

15+
.. include:: /includes/extracts/fact-text-search-legacy-atlas.rst
16+
1517
Overview
1618
--------
1719

source/core/link-text-indexes.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
============
2-
Text Indexes
3-
============
1+
.. _text-search-on-premises:
2+
3+
================================================
4+
Perform a Text Search (Self-Managed Deployments)
5+
================================================
46

57
.. default-domain:: mongodb
68

source/core/text-search-operators.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
=====================
2-
Text Search Operators
3-
=====================
1+
.. _text-search-operators-on-premises:
2+
3+
================================================
4+
Text Search Operators (Self-Managed Deployments)
5+
================================================
46

57
.. default-domain:: mongodb
68

@@ -10,9 +12,7 @@ Text Search Operators
1012
:depth: 1
1113
:class: singlecol
1214

13-
.. note::
14-
15-
.. include:: /includes/extracts/views-unsupported-text-search.rst
15+
.. include:: /includes/extracts/fact-text-search-legacy-atlas.rst
1616

1717
Query Framework
1818
---------------

source/core/text-search/on-prem.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _text-search-on-prem:
2+
3+
=======================================
4+
Text Search on Self-Managed Deployments
5+
=======================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. toctree::
10+
:titlesonly:
11+
12+
/core/link-text-indexes
13+
/core/text-search-operators
14+
/tutorial/text-search-in-aggregation
15+
/reference/text-search-languages
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ref: fact-text-search-legacy-atlas
2+
content: |
3+
4+
.. note::
5+
6+
This page describes text search capabilities for self-managed
7+
(non-Atlas) deployments. For data hosted on MongoDB Atlas, MongoDB
8+
offers an improved full-text search solution, :atlas:`Atlas Search
9+
</atlas-search/>`.
10+
11+
---
12+
ref: fact-regex-search-legacy-atlas
13+
content: |
14+
15+
**For data hosted on MongoDB Atlas**, MongoDB offers a
16+
full-text search solution, :atlas:`MongoDB Atlas Search
17+
</atlas-search/>`. If you frequently run case-insensitive regex
18+
queries (utilizing the ``i`` option), MongoDB recommends Atlas Search
19+
queries that use the :pipeline:`$search` aggregation pipeline stage.
20+
21+
:atlas:`Atlas Search queries </reference/atlas-search/searching/>`
22+
significiantly improve the performance of text queries and offer more
23+
options for customizing query parameters. To learn more, see
24+
:atlas:`MongoDB Atlas Search </atlas-search/>`.
25+
26+
**For self-managed deployments**, you can find information on our
27+
regex capability below.
28+
29+
...
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
For data hosted on MongoDB Atlas, you can support full-text search with
2+
Atlas Search indexes. To learn more, see :atlas:`Create an Atlas Search
3+
Index </atlas-search/create-index/>`.
4+
5+
For self-managed (non-Atlas) deployments, MongoDB provides a ``text``
6+
index type that supports searching for string content in a collection.
7+
To learn more about self-managed text indexes, see
8+
:ref:`index-feature-text`.

source/indexes.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,10 @@ planar geometry when returning results and :doc:`2dsphere indexes
176176
See :doc:`/core/geospatial-indexes` for a high level introduction to
177177
geospatial indexes.
178178

179-
Text Indexes
180-
~~~~~~~~~~~~
181-
182-
MongoDB provides a ``text`` index type that supports searching
183-
for string content in a collection. These text indexes do not store
184-
language-specific *stop* words (e.g. "the", "a", "or") and *stem* the
185-
words in a collection to only store root words.
179+
Text Search Indexes
180+
~~~~~~~~~~~~~~~~~~~
186181

187-
See :doc:`/core/index-text` for more information on text indexes and
188-
search.
182+
.. include:: /includes/indexes/text-search-indexes-overview.rst
189183

190184
Hashed Indexes
191185
~~~~~~~~~~~~~~

source/reference/operator/query/regex.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ $regex
1212

1313
.. meta::
1414
:description: pattern matching on strings in MongoDB |version|
15-
:keywords: regex, regular expressions, LIKE queries, wildcard matches, pattern matches, MongoDB |version|, version |version|
15+
:keywords: regex, regular expressions, LIKE queries, wildcard matches, pattern matches, MongoDB |version|, version |version|
16+
17+
.. note::
18+
19+
This page describes regular expression search capabilities for
20+
self-managed (non-Atlas) deployments. For data hosted on MongoDB
21+
Atlas, MongoDB offers an improved full-text search solution,
22+
:atlas:`Atlas Search </atlas-search/>`, which has its own ``$regex``
23+
operator. To learn more, see :atlas:`$regex </atlas-search/regex/>`
24+
in the Atlas Search documentation.
1625

1726
Definition
1827
----------

source/text-search.txt

Lines changed: 34 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -10,109 +10,54 @@ Text Search
1010
:depth: 1
1111
:class: singlecol
1212

13-
Overview
14-
--------
13+
MongoDB provides different text search capabilities depending on whether
14+
your data is hosted on :atlas:`MongoDB Atlas </>` or a self-managed
15+
deployment.
1516

16-
MongoDB supports query operations that perform a text search of string
17-
content. To perform text search, MongoDB uses a
18-
:ref:`text index <index-feature-text>` and the :query:`$text` operator.
17+
MongoDB Atlas Search
18+
--------------------
1919

20-
.. note::
21-
22-
.. include:: /includes/extracts/views-unsupported-text-search.rst
23-
24-
Example
25-
-------
26-
27-
This example demonstrates how to build a text index and use it to find
28-
coffee shops, given only text fields.
29-
30-
Create a collection ``stores`` with the following documents:
31-
32-
.. code-block:: javascript
33-
34-
db.stores.insert(
35-
[
36-
{ _id: 1, name: "Java Hut", description: "Coffee and cakes" },
37-
{ _id: 2, name: "Burger Buns", description: "Gourmet hamburgers" },
38-
{ _id: 3, name: "Coffee Shop", description: "Just coffee" },
39-
{ _id: 4, name: "Clothes Clothes Clothes", description: "Discount clothing" },
40-
{ _id: 5, name: "Java Shopping", description: "Indonesian goods" }
41-
]
42-
)
43-
44-
Text Index
45-
~~~~~~~~~~
46-
47-
.. include:: /includes/fact-text-index.rst
48-
49-
.. include:: /includes/fact-create-text-index.rst
50-
51-
``$text`` Operator
52-
~~~~~~~~~~~~~~~~~~
53-
54-
.. include:: /includes/fact-use-text-operator.rst
20+
To perform text search on data hosted on MongoDB Atlas, use
21+
:atlas:`MongoDB Atlas Search </atlas-search>`. Atlas Search supports
22+
fine-grained text indexing and a rich query language for fast, relevant
23+
search results.
5524

56-
Exact Phrase
57-
````````````
25+
To learn more and get started with Atlas Search, see:
5826

59-
You can also search for exact phrases by wrapping them in double-quotes.
60-
If the ``$search`` string includes a phrase and individual terms, text search
61-
will only match documents that include the phrase.
27+
- :atlas:`Atlas Search Aggregation Pipeline Stages
28+
</reference/atlas-search/query-syntax/>`
29+
- :atlas:`Defining Atlas Search Indexes
30+
</reference/atlas-search/index-definitions/>`
31+
- :atlas:`Running Atlas Search Queries
32+
</reference/atlas-search/searching/>`
6233

63-
For example, the following will find all documents containing
64-
"coffee shop":
65-
66-
.. code-block:: javascript
67-
68-
db.stores.find( { $text: { $search: "\"coffee shop\"" } } )
69-
70-
For more information, see :ref:`text-operator-phrases`.
71-
72-
Term Exclusion
73-
``````````````
74-
75-
To exclude a word, you can prepend a "``-``" character. For example, to
76-
find all stores containing "java" or "shop" but not "coffee", use the
77-
following:
78-
79-
.. code-block:: javascript
80-
81-
db.stores.find( { $text: { $search: "java shop -coffee" } } )
82-
83-
Sorting
84-
```````
85-
86-
MongoDB will return its results in unsorted order by default. However,
87-
text search queries will compute a relevance score for each document
88-
that specifies how well a document matches the query.
34+
.. include:: /includes/fact-atlas-search-languages.rst
8935

90-
To sort the results in order of relevance score, you must explicitly
91-
project the :expression:`$meta` ``textScore`` field and sort on it:
36+
Text Search on Self-Managed Deployments
37+
---------------------------------------
9238

93-
.. code-block:: javascript
39+
For self-managed (non-Atlas) deployments, MongoDB's text search
40+
capability supports query operations that perform a text search of
41+
string content. To perform text search, MongoDB uses a :ref:`text index
42+
<index-feature-text>` and the :query:`$text` operator.
9443

95-
db.stores.find(
96-
{ $text: { $search: "java coffee shop" } },
97-
{ score: { $meta: "textScore" } }
98-
).sort( { score: { $meta: "textScore" } } )
44+
.. note::
9945

100-
Text search is also available in the aggregation pipeline.
46+
.. include:: /includes/extracts/views-unsupported-text-search.rst
10147

102-
Language Support
103-
----------------
48+
To learn more about text search for self-managed deployments, see:
49+
50+
- :doc:`Text Indexes </core/link-text-indexes/>`
51+
- :doc:`Text Search Operators </core/text-search-operators/>`
10452

105-
MongoDB supports text search for various languages. See
106-
:doc:`/reference/text-search-languages` for a list of supported
107-
languages.
53+
MongoDB also supports text search for various languages. For a list of
54+
supported languages, see :ref:`text-search-languages`.
10855

10956
.. include:: /includes/fact-atlas-search-languages.rst
11057

11158
.. toctree::
11259
:titlesonly:
11360
:hidden:
114-
115-
/core/link-text-indexes
116-
/core/text-search-operators
117-
/tutorial/text-search-in-aggregation
118-
/reference/text-search-languages
61+
62+
MongoDB Atlas Search <https://www.mongodb.com/docs/atlas/atlas-search/>
63+
/core/text-search/on-prem

source/tutorial/create-indexes-to-support-queries.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ can support all the queries that search a "prefix" subset of those fields.
8888

8989
.. include:: /includes/fact-index-intersection-vs-compound-indexes.rst
9090

91+
Create Indexes to Support Text Search
92+
-------------------------------------
93+
94+
.. include:: /includes/indexes/text-search-indexes-overview.rst
95+
9196
Index Use and Collation
9297
-----------------------
9398

9499
.. include:: /includes/extracts/collation-index-use.rst
95-

0 commit comments

Comments
 (0)