Freigeben über


New-AzCosmosDBSqlIndexingPolicy

Erstellt ein neues CosmosDB Sql IndexingPolicy -Objekt.

Syntax

New-AzCosmosDBSqlIndexingPolicy
   [-IncludedPath <PSIncludedPath[]>]
   [-SpatialSpec <PSSpatialSpec[]>]
   [-CompositePath <PSCompositePath[][]>]
   [-ExcludedPath <String[]>]
   [-Automatic <Boolean>]
   [-IndexingMode <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Beschreibung

Das Cmdlet New-AzCosmosDBSqlIndexingPolicy erstellt ein neues Objekt vom Typ PSSqlIndexingPolicy.

Beispiele

Beispiel 1

$ipath1 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$ipath2 = New-AzCosmosDBSqlIncludedPathIndex -DataType String -Precision -1 -Kind Hash
$IncludedPath = New-AzCosmosDBSqlIncludedPath -Path "/*" -Index $ipath1, $ipath2
$SpatialSpec = New-AzCosmosDBSqlSpatialSpec -Path  "/mySpatialPath/*" -Type  "Point", "LineString", "Polygon", "MultiPolygon"
$cp1 = New-AzCosmosDBSqlCompositePath -Path "/abc" -Order Ascending
$cp2 = New-AzCosmosDBSqlCompositePath -Path "/aberc" -Order Descending
$compositePath = (($cp1, $cp2), ($cp2, $cp1))
New-AzCosmosDBSqlIndexingPolicy -IncludedPath $IncludedPath -SpatialSpec $SpatialSpec -CompositePath $compositePath -ExcludedPath "/myPathToNotIndex/*" -Automatic 1 -IndexingMode Consistent

Automatic        : True
IndexingMode     : Consistent
IncludedPaths    : {Microsoft.Azure.Commands.CosmosDB.Models.PSIncludedPath}
ExcludedPaths    : {Microsoft.Azure.Commands.CosmosDB.Models.PSExcludedPath}
CompositeIndexes : {Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath,
                   Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath}
SpatialIndexes   : {Microsoft.Azure.Commands.CosmosDB.Models.PSSpatialSpec}

Parameter

-Automatic

Bool, um anzugeben, ob die Indizierungsrichtlinie automatisch ist

Typ:Nullable<T>[Boolean]
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-CompositePath

Array von Objekten vom Typ "Microsoft.Azure.Commands.CosmosDB.PSCompositePath"

Typ:PSCompositePath[][]
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-DefaultProfile

Anmeldeinformationen, Konto, Mandant und Abonnement für die Kommunikation mit Azure

Typ:IAzureContextContainer
Aliase:AzContext, AzureRmContext, AzureCredential
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-ExcludedPath

Array von Zeichenfolgen, die excludedPath enthalten(Gibt einen Pfad innerhalb eines JSON-Dokuments an, die in den Azure Cosmos DB-Diensten ausgeschlossen werden sollen.) Elemente.

Typ:String[]
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-IncludedPath

Array von Zeichenfolgen, die includedPath enthalten (Gibt einen Pfad innerhalb eines JSON-Dokuments an, die in die Azure Cosmos DB-Dienstelemente eingeschlossen werden sollen.)

Typ:PSIncludedPath[]
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-IndexingMode

gibt den Indizierungsmodus an. Mögliche Werte sind: 'Konsistent', 'Lazy', 'None'

Typ:String
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

-SpatialSpec

Array von Objekten vom Typ "Microsoft.Azure.Commands.CosmosDB.PSSpatialSpec"

Typ:PSSpatialSpec[]
Position:Named
Standardwert:None
Erforderlich:False
Pipelineeingabe akzeptieren:False
Platzhalterzeichen akzeptieren:False

Eingaben

None

Ausgaben

PSSqlIndexingPolicy