Skip to content

Commit 7d3df3e

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 026d094 commit 7d3df3e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Diff for: 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.

Diff for: source/indexes.txt

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

54-
- :ref:`Single Field Index <indexes-single-field>` on an object
54+
.. note::
55+
56+
.. include:: /includes/indexes/embedded-object-need-entire-doc.rst
57+
58+
- :ref:`Single Field Index <indexes-single-field>` on an embedded
59+
document
5560

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

0 commit comments

Comments
 (0)