You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/index-policy.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
title: Azure Cosmos DB indexing policies
3
3
description: Learn how to configure and change the default indexing policy for automatic indexing and greater performance in Azure Cosmos DB.
4
-
author: ThomasWeiss
4
+
author: timsander1
5
5
ms.service: cosmos-db
6
6
ms.topic: conceptual
7
-
ms.date: 09/10/2019
8
-
ms.author: thweiss
7
+
ms.date: 03/26/2020
8
+
ms.author: tisande
9
9
---
10
10
11
11
# Indexing policies in Azure Cosmos DB
@@ -25,7 +25,7 @@ Azure Cosmos DB supports two indexing modes:
25
25
-**None**: Indexing is disabled on the container. This is commonly used when a container is used as a pure key-value store without the need for secondary indexes. It can also be used to improve the performance of bulk operations. After the bulk operations are complete, the index mode can be set to Consistent and then monitored using the [IndexTransformationProgress](how-to-manage-indexing-policy.md#use-the-net-sdk-v2) until complete.
26
26
27
27
> [!NOTE]
28
-
> Cosmos DB also supports a Lazy indexing mode. Lazy indexing performs updates to the index at a much lower priority level when the engine is not doing any other work. This can result in **inconsistent or incomplete** query results. Additionally, using Lazy indexing in place of 'None' for bulk operations also provides no benefit as any change to the Index Mode will cause the index to be dropped and recreated. For these reasons we recommend against customers using it. To improve performance for bulk operations, set index mode to None, then return to Consistent mode and monitor the `IndexTransformationProgress` property on the container until complete.
28
+
> Azure Cosmos DB also supports a Lazy indexing mode. Lazy indexing performs updates to the index at a much lower priority level when the engine is not doing any other work. This can result in **inconsistent or incomplete** query results. If you plan to query a Cosmos container, you should not select lazy indexing.
29
29
30
30
By default, indexing policy is set to `automatic`. It's achieved by setting the `automatic` property in the indexing policy to `true`. Setting this property to `true` allows Azure CosmosDB to automatically index documents as they are written.
31
31
@@ -68,9 +68,11 @@ Any indexing policy has to include the root path `/*` as either an included or a
68
68
- Include the root path to selectively exclude paths that don't need to be indexed. This is the recommended approach as it lets Azure Cosmos DB proactively index any new property that may be added to your model.
69
69
- Exclude the root path to selectively include paths that need to be indexed.
70
70
71
-
- For paths with regular characters that include: alphanumeric characters and _ (underscore), you don’t have to escape the path string around double quotes (for example, "/path/?"). For paths with other special characters, you need to escape the path string around double quotes (for example, "/\"path-abc\"/?"). If you expect special characters in your path, you can escape every path for safety. Functionally it doesn’t make any difference if you escape every path Vs just the ones that have special characters.
71
+
- For paths with regular characters that include: alphanumeric characters and _ (underscore), you don't have to escape the path string around double quotes (for example, "/path/?"). For paths with other special characters, you need to escape the path string around double quotes (for example, "/\"path-abc\"/?"). If you expect special characters in your path, you can escape every path for safety. Functionally it doesn't make any difference if you escape every path Vs just the ones that have special characters.
72
72
73
-
- The system property "_etag" is excluded from indexing by default, unless the etag is added to the included path for indexing.
73
+
- The system property `_etag` is excluded from indexing by default, unless the etag is added to the included path for indexing.
74
+
75
+
- If the indexing mode is set to **consistent**, the system properties `id` and `_ts` are automatically indexed.
74
76
75
77
When including and excluding paths, you may encounter the following attributes:
0 commit comments