replaced lazy by consistent indexing to get free socks :) (#418)
* added comment on lazy indexing to get free socks :) * replaced custom policy by a recommended one
This commit is contained in:
Родитель
ba7bb902b3
Коммит
fe1c18a874
|
@ -103,20 +103,20 @@
|
|||
|
||||
private static async Task CreateContainerWithCustomIndexingPolicy()
|
||||
{
|
||||
// Create a container with custom index policy (lazy indexing)
|
||||
// Create a container with custom index policy (consistent indexing)
|
||||
// We cover index policies in detail in IndexManagement sample project
|
||||
CosmosContainerSettings containerSettings = new CosmosContainerSettings(
|
||||
id: "SampleContainerWithCustomIndexPolicy",
|
||||
partitionKeyPath: partitionKey);
|
||||
containerSettings.IndexingPolicy.IndexingMode = IndexingMode.Lazy;
|
||||
containerSettings.IndexingPolicy.IndexingMode = IndexingMode.Consistent;
|
||||
|
||||
CosmosContainer containerWithLazyIndexing = await database.CreateContainerIfNotExistsAsync(
|
||||
CosmosContainer containerWithConsistentIndexing = await database.CreateContainerIfNotExistsAsync(
|
||||
containerSettings,
|
||||
requestUnitsPerSecond: 400);
|
||||
|
||||
Console.WriteLine($"1.2. Created Container {containerWithLazyIndexing.Id}, with custom index policy \n");
|
||||
Console.WriteLine($"1.2. Created Container {containerWithConsistentIndexing.Id}, with custom index policy \n");
|
||||
|
||||
await containerWithLazyIndexing.DeleteAsync();
|
||||
await containerWithConsistentIndexing.DeleteAsync();
|
||||
}
|
||||
|
||||
private static async Task CreateContainerWithTtlExpiration()
|
||||
|
|
Загрузка…
Ссылка в новой задаче