AzureCosmosDB / data-migration-desktop-tool

MIT License
129 stars 53 forks source link

IndexingPolicyFile Equivalent ? #109

Open DadvDadv opened 9 months ago

DadvDadv commented 9 months ago

Before we have a settings name "IndexingPolicyFile" where we can set a specific file for configurate indexing policy in Cosmos Db.

I didn't find any equivalent in the new core project or extension.

How could I have the policy inserted before the data integration (json => cosmos db) ?

DadvDadv commented 9 months ago

I finaly add it directly in the Comos Extension :

CosmosSettingsBase.cs : public IndexingPolicy? IndexingPolicy { get; set; }

CosmosDataSinkExtension.cs :

var containerProperties = new ContainerProperties { Id = settings.Container, PartitionKeyDefinitionVersion = PartitionKeyDefinitionVersion.V2 }; if(settings.IndexingPolicy != null) containerProperties.IndexingPolicy = settings.IndexingPolicy; //add the policy

migrationsettings.json :

"SinkSettings": { "IndexingPolicy": { "indexingMode": "consistent", "automatic": true, "includedPaths": [], "excludedPaths": [ { "path": "/*" }, { "path": "/\"_etag\"/?" } ] } }