Nest : Bulk insert or update

Hi ,
Can any one provide sample code to insertorupdate document into ES index. I tried below code but it is creating single document (i have 300 rows in sql). I want to have single method to insert or update as I am not sure if the document is created or updated at source. Please help.
var descriptor = new BulkDescriptor();
descriptor.Index(ESIConfig.DataSync.CatalogName);
foreach (var item in data)
{
descriptor.Update<Dictionary<string, object>>(u => u.Id(ESIConfig.DataSync.UniqueIDColumn).Doc(item).DocAsUpsert());
}
var res = Client.Bulk(d => descriptor);

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.