Class IndexingPolicy
Represents the indexing policy configuration for a collection in the Azure Cosmos DB service.
public sealed class IndexingPolicy
- Inheritance
-
IndexingPolicy
- Inherited Members
- Extension Methods
Remarks
Indexing policies can used to configure which properties (JSON paths) are included/excluded, whether the index is updated consistently or offline (lazy), automatic vs. opt-in per-document, as well as the precision and type of index per path.
Refer to https://docs.microsoft.com/azure/cosmos-db/index-policy for additional information on how to specify indexing policies.
Constructors
IndexingPolicy()
Initializes a new instance of the IndexingPolicy class for the Azure Cosmos DB service.
public IndexingPolicy()
Remarks
Indexing mode is set to consistent.
- See Also
Properties
Automatic
Gets or sets a value that indicates whether automatic indexing is enabled for a collection in the Azure Cosmos DB service.
public bool Automatic { get; set; }
Property Value
- bool
True, if automatic indexing is enabled; otherwise, false.
Remarks
In automatic indexing, documents can be explicitly excluded from indexing using Microsoft.Azure.Documents.Client.RequestOptions.
In manual indexing, documents can be explicitly included.
- See Also
CompositeIndexes
Gets the composite indexes for additional indexes
public Collection<Collection<CompositePath>> CompositeIndexes { get; }
Property Value
Examples
"composite": [ [ { "path": "/joining_year", "order": "ascending" }, { "path": "/level", "order": "descending" } ], [ { "path": "/country" }, { "path": "/city" } ] ]
- See Also
ExcludedPaths
Gets the collection containing ExcludedPath objects in the Azure Cosmos DB service.
public Collection<ExcludedPath> ExcludedPaths { get; }
Property Value
- Collection<ExcludedPath>
The collection containing ExcludedPath objects.
- See Also
IncludedPaths
Gets the collection containing IncludedPath objects in the Azure Cosmos DB service.
public Collection<IncludedPath> IncludedPaths { get; }
Property Value
- Collection<IncludedPath>
The collection containing IncludedPath objects.
- See Also
IndexingMode
Gets or sets the indexing mode (consistent or lazy) in the Azure Cosmos DB service.
public IndexingMode IndexingMode { get; set; }
Property Value
- IndexingMode
One of the values of the IndexingMode enumeration.
- See Also
SpatialIndexes
Collection of spatial index definitions to be used
public Collection<SpatialPath> SpatialIndexes { get; }
Property Value
- See Also