Skip to content

Commit d32c1af

Browse files
authored
Backport DOCSP-25663) to v6.0 (#1995) (#2010)
* Add Atlas Search alternative to Index Intersection page * copy review feedback * copy review 2
1 parent 7110205 commit d32c1af

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

source/core/index-intersection.txt

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Index Intersection
1313
.. important::
1414

1515
This page documents cases where the :doc:`query optimizer
16-
</core/query-plans>` **may** be able to use index intersection.
16+
</core/query-plans>` **may** be able to use index intersection.
1717

1818
In practice, the :doc:`query optimizer </core/query-plans>` rarely
1919
selects plans that use index intersection.
@@ -24,7 +24,7 @@ Index Intersection
2424

2525
Schema designs should not rely on index intersection. Instead,
2626
:doc:`compound indexes </core/index-compound>` should be used.
27-
27+
2828
Future improvements to the query optimizer may allow the system to
2929
better identify cases where an index intersection plan would be
3030
beneficial.
@@ -89,7 +89,13 @@ index) and the sort order (i.e. ascending or descending), matter in
8989
:doc:`compound indexes </core/index-compound>`, a compound index may
9090
not support a query condition that does not include the :ref:`index
9191
prefix keys <compound-index-prefix>` or that specifies a different sort
92-
order.
92+
order.
93+
94+
.. note::
95+
96+
For deployments hosted on MongoDB Atlas, consider using
97+
:ref:`Atlas Search indexes <index-intersection-search>`
98+
to avoid limitations due to field order.
9399

94100
For example, if a collection ``orders`` has the following compound
95101
index, with the ``status`` field listed before the ``ord_date`` field:
@@ -171,3 +177,33 @@ part of the query predicate.
171177
.. code-block:: javascript
172178

173179
db.orders.find( { qty: { $gt: 10 } , status: "A" } ).sort( { ord_date: -1 } )
180+
181+
.. _index-intersection-search:
182+
183+
Index Intersection and Atlas Search Indexes
184+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185+
186+
If you use MongoDB Atlas, you can create an Atlas Search index to
187+
fulfill queries when the query optimizer selects a plan that involves
188+
index intersection. Unlike :ref:`compound indexes
189+
<index-intersection-compound-indexes>`, fields in Atlas Search indexes
190+
can be defined in any order. As a result, the Atlas Seach index can
191+
support queries that:
192+
193+
- Specify a different sort order than the index sort order.
194+
- Contain fields that are not part of the :ref:`index prefix
195+
<compound-index-prefix>`.
196+
197+
For a tutorial on using Atlas Search indexes when index
198+
intersection is required, see `Flexible Querying with Atlas Search
199+
<https://www.mongodb.com/developer/products/atlas/flexible-querying-with-atlas-search/>`__.
200+
201+
.. note::
202+
203+
Atlas Search Indexes are only available for MongoDB Atlas clusters,
204+
and is not available for self-managed deployments. To
205+
learn more, see:
206+
207+
- :atlas:`Atlas Search Overview </atlas-search/>`
208+
- :atlas:`Atlas Search Index Definitions </reference/atlas-search/index-definitions/>`
209+

0 commit comments

Comments
 (0)