diff --git a/source/core/indexes/index-types/index-single/create-single-field-index.txt b/source/core/indexes/index-types/index-single/create-single-field-index.txt index edeaf00c6ab..3b14149e1ac 100644 --- a/source/core/indexes/index-types/index-single/create-single-field-index.txt +++ b/source/core/indexes/index-types/index-single/create-single-field-index.txt @@ -122,9 +122,7 @@ The following query uses the index on the ``location`` field: Details ``````` -When you create an index on an embedded document, only queries that -specify the *entire* embedded document use the index. Queries on a -specific field within the document do not use the index. +.. include:: /includes/indexes/embedded-object-need-entire-doc.rst For example, the following queries *do not* use the index on the ``location`` field because they query on specific fields within the diff --git a/source/includes/indexes/embedded-object-need-entire-doc.rst b/source/includes/indexes/embedded-object-need-entire-doc.rst new file mode 100644 index 00000000000..c413f2022e0 --- /dev/null +++ b/source/includes/indexes/embedded-object-need-entire-doc.rst @@ -0,0 +1,3 @@ +When you create an index on an embedded document, only queries that +specify the entire embedded document use the index. Queries on a +specific field within the document do not use the index. diff --git a/source/indexes.txt b/source/indexes.txt index fe7bc627ab7..88e15beff97 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -52,10 +52,15 @@ example, consider the following scenarios: * - A salesperson often needs to look up client information by location. Location is stored in an embedded object with fields like ``state``, ``city``, and ``zipcode``. You can create an - index on the entire ``location`` object to improve performance - for queries on any field in that object. + index on the ``location`` object to improve performance for + queries on that object. - - :ref:`Single Field Index ` on an object + .. note:: + + .. include:: /includes/indexes/embedded-object-need-entire-doc.rst + + - :ref:`Single Field Index ` on an embedded + document * - A grocery store manager often needs to look up inventory items by name and quantity to determine which items are low stock. You can