Skip to content

Commit 8eff978

Browse files
(DOCSP-36307): Fix inaccuracy for index on embedded field (#6263)
* (DOCSP-36307): Fix inaccuracy for index on embedded field * tweak * spacing
1 parent a320309 commit 8eff978

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

source/core/indexes/index-types/index-single/create-single-field-index.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ The following query uses the index on the ``location`` field:
122122
Details
123123
```````
124124

125-
When you create an index on an embedded document, only queries that
126-
specify the *entire* embedded document use the index. Queries on a
127-
specific field within the document do not use the index.
125+
.. include:: /includes/indexes/embedded-object-need-entire-doc.rst
128126

129127
For example, the following queries *do not* use the index on the
130128
``location`` field because they query on specific fields within the
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When you create an index on an embedded document, only queries that
2+
specify the entire embedded document use the index. Queries on a
3+
specific field within the document do not use the index.

source/indexes.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,15 @@ example, consider the following scenarios:
5252
* - A salesperson often needs to look up client information by
5353
location. Location is stored in an embedded object with fields
5454
like ``state``, ``city``, and ``zipcode``. You can create an
55-
index on the entire ``location`` object to improve performance
56-
for queries on any field in that object.
55+
index on the ``location`` object to improve performance for
56+
queries on that object.
5757

58-
- :ref:`Single Field Index <indexes-single-field>` on an object
58+
.. note::
59+
60+
.. include:: /includes/indexes/embedded-object-need-entire-doc.rst
61+
62+
- :ref:`Single Field Index <indexes-single-field>` on an embedded
63+
document
5964

6065
* - A grocery store manager often needs to look up inventory items by
6166
name and quantity to determine which items are low stock. You can

0 commit comments

Comments
 (0)