-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
NEST/Elasticsearch.Net version: 2.4.6
Elasticsearch version: 2.4.1
I need to do partial updates in a bulk, so have the following code:
var descriptor = new BulkDescriptor();
var str = "{ \"Location\": null, \"Id\": \"1_1\", \"ContactId\": 1, \"ClientId\": 1}";
var partialObject = JsonConvert.DeserializeObject<dynamic>(str);
// This works fine
var response = client.Update<MyType, object>(DocumentPath<MyType>.Id("1_1").Index("Index1"),u => u.Doc(partialObject));
// This works fine also
descriptor.Update<MyType, dynamic>(
op => op
.Index("Index1")
.Id("1_1")
.Doc(new { Id = "1_1", ContactId = 1, ClientId = 1 })
.DocAsUpsert());
// Here it takes forever to process (looks like it gets into infinitive loop) without any exception
descriptor.Update<MyType, dynamic>(op => op.Index("Index1").Id("1_1").Doc(partialObject).DocAsUpsert());
Some notes:
It looks that it happens because I've "Location": nul field on my dynamic. But why then it works fine with the Update method (not in a BulkDescriptor)
I need partial update to update all the fields on my object even if they are null. I can't use an exact type because I have a big type that is stored at Elastic index so I'm building dynamic object with those fields that I really need to update.
Metadata
Metadata
Assignees
Labels
No labels