Skip to content

Commit 9225c4a

Browse files
authored
Merge pull request #109076 from timsander1/master
update indexing guidance
2 parents 68ed4df + 931490d commit 9225c4a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

articles/cosmos-db/index-policy.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Azure Cosmos DB indexing policies
33
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
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 09/10/2019
8-
ms.author: thweiss
7+
ms.date: 03/26/2020
8+
ms.author: tisande
99
---
1010

1111
# Indexing policies in Azure Cosmos DB
@@ -25,7 +25,7 @@ Azure Cosmos DB supports two indexing modes:
2525
- **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.
2626

2727
> [!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.
2929
3030
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.
3131

@@ -68,9 +68,11 @@ Any indexing policy has to include the root path `/*` as either an included or a
6868
- 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.
6969
- Exclude the root path to selectively include paths that need to be indexed.
7070

71-
- For paths with regular characters that include: alphanumeric characters and _ (underscore), you dont 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 doesnt 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.
7272

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.
7476

7577
When including and excluding paths, you may encounter the following attributes:
7678

0 commit comments

Comments
 (0)