Bulk Partial Update using Nest


(Pavan) #1

Is it possible to perform bulk partial updates using Nest ?
Right now the following following code snippet does the update for a single document.

elasticClient.Update<MyModel, object>(u => u
.Id(documentId)
.Doc(new
{
Remarks = remarks
})
.RetryOnConflict(3)
.Refresh().Index(indexName));

Thanks,
Pavan


NEST and Bulk operations of parital Updates (specifically UpdateMany)
(Erkan Aslanel) #2

Hello, this code works on NEST version="2.4.1"

            var descriptor = new BulkDescriptor();

            foreach (var item in updateList)
            {
                descriptor.Update<VendorProductSearchModel, PartialVendorProductStoreListUpdate>(a => a.Id(item.VendorProductId).Doc(item.PartialUpdate));
            }

            var resp = _client.Bulk(descriptor);

(system) #3