IndexingPolicy Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
IndexingPolicy() |
Initializes a new instance of the IndexingPolicy class for the Azure Cosmos DB service. |
IndexingPolicy(Index[]) |
Initializes a new instance of the IndexingPolicy class with the specified set of indexes as default index specifications for the root path for the Azure Cosmos DB service. |
IndexingPolicy()
Initializes a new instance of the IndexingPolicy class for the Azure Cosmos DB service.
public IndexingPolicy ();
Public Sub New ()
Remarks
Indexing mode is set to consistent.
Applies to
IndexingPolicy(Index[])
Initializes a new instance of the IndexingPolicy class with the specified set of indexes as default index specifications for the root path for the Azure Cosmos DB service.
public IndexingPolicy (params Microsoft.Azure.Documents.Index[] defaultIndexOverrides);
new Microsoft.Azure.Documents.IndexingPolicy : Microsoft.Azure.Documents.Index[] -> Microsoft.Azure.Documents.IndexingPolicy
Public Sub New (ParamArray defaultIndexOverrides As Index())
Parameters
- defaultIndexOverrides
- Index[]
Comma seperated set of indexes that serve as default index specifications for the root path.
Examples
The following example shows how to override the default indexingPolicy for root path:
HashIndex hashIndexOverride = Index.Hash(DataType.String, 5);
RangeIndex rangeIndexOverride = Index.Range(DataType.Number, 2);
SpatialIndex spatialIndexOverride = Index.Spatial(DataType.Point);
IndexingPolicy indexingPolicy = new IndexingPolicy(hashIndexOverride, rangeIndexOverride, spatialIndexOverride);
If you would like to just override the indexingPolicy for Numbers you can specify just that:
RangeIndex rangeIndexOverride = Index.Range(DataType.Number, 2);
IndexingPolicy indexingPolicy = new IndexingPolicy(rangeIndexOverride);
See also
Applies to
Azure SDK for .NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기