# ES 0.90.5 Bulk Update does not seem to work properly

**URL:** <https://discuss.elastic.co/t/es-0-90-5-bulk-update-does-not-seem-to-work-properly/13937>\
**Category:** Elasticsearch\
**Created:** [October 14, 2013, 7:15am UTC](https://discuss.elastic.co/t/es-0-90-5-bulk-update-does-not-seem-to-work-properly/13937 "2013-10-14T07:15:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![george\_monroe](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@george\_monroe](https://discuss.elastic.co/u/george_monroe)\
**Post date:** [October 14, 2013, 7:15am UTC](https://discuss.elastic.co/t/es-0-90-5-bulk-update-does-not-seem-to-work-properly/13937/1 "2013-10-14T07:15:19Z")

</div>

Hi,

I've downloaded the new ES 0.90.5 and I'm running the following bulk  
statements:

test.json:

{ "index" : { "\_index" : "test", "\_type" : "type1", "\_id" : "1" } }  
{ "field\_1" : "value\_1" }  
{ "delete" : { "\_index" : "test", "\_type" : "type1", "\_id" : "2" } }  
{ "create" : { "\_index" : "test", "\_type" : "type1", "\_id" : "3" } }  
{ "field\_1" : "value\_3" }  
{ "update" : {"\_id" : "1", "\_type" : "type1", "\_index" : "test"} }  
{ "doc" : {"field\_2" : "value\_2"} }  
{ "update" : {"\_id" : "1", "\_type" : "type1", "\_index" : "test",  
"\_retry\_on\_conflict" : 3} }  
{ "script" : "ctx.\_source.field\_1 : "new content"" }

curl -XPOST 'localhost:9200/\_bulk?pretty' --data-binary @test.json

I get the following response, which says that both updates succeeded:

{  
"took" : 139,  
"items" : [ {  
"index" : {  
"\_index" : "test",  
"\_type" : "type1",  
"\_id" : "1",  
"\_version" : 1,  
"ok" : true  
}  
}, {  
"delete" : {  
"\_index" : "test",  
"\_type" : "type1",  
"\_id" : "2",  
"\_version" : 1,  
"ok" : true,  
"found" : false  
}  
}, {  
"create" : {  
"\_index" : "test",  
"\_type" : "type1",  
"\_id" : "3",  
"\_version" : 1,  
"ok" : true  
}  
}, {  
"update" : {  
"\_index" : "test",  
"\_type" : "type1",  
"\_id" : "1",  
"\_version" : 2,  
"ok" : true  
}  
}, {  
"update" : {  
"\_index" : "test",  
"\_type" : "type1",  
"\_id" : "1",  
"\_version" : 3,  
"ok" : true  
}  
} ]

But the data shows the following (What am I doing wrong??):

{

- \_index: test
- \_type: type1
- \_id: 1
- \_version: 3
- \_score: 1
- \_source: {
  - field\_1: value\_1
  - field\_2: value\_2  
}

}

What am I doing wrong?

Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![george\_monroe](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@george\_monroe](https://discuss.elastic.co/u/george_monroe)\
**Post date:** [October 14, 2013, 7:18am UTC](https://discuss.elastic.co/t/es-0-90-5-bulk-update-does-not-seem-to-work-properly/13937/2 "2013-10-14T07:18:21Z")

</div>

I figured it out as soon as I had clicked post....

Instead of { "script" : "ctx.\_source.field\_1 : "new content"" }

I should have { "script" : "ctx.\_source.field\_1 = "new content"" }

On Monday, October 14, 2013 12:15:19 AM UTC-7, george\_monroe wrote:

> Hi,
> 
> I've downloaded the new ES 0.90.5 and I'm running the following bulk  
> statements:
> 
> test.json:
> 
> { "index" : { "\_index" : "test", "\_type" : "type1", "\_id" : "1" } }  
> { "field\_1" : "value\_1" }  
> { "delete" : { "\_index" : "test", "\_type" : "type1", "\_id" : "2" } }  
> { "create" : { "\_index" : "test", "\_type" : "type1", "\_id" : "3" } }  
> { "field\_1" : "value\_3" }  
> { "update" : {"\_id" : "1", "\_type" : "type1", "\_index" : "test"} }  
> { "doc" : {"field\_2" : "value\_2"} }  
> { "update" : {"\_id" : "1", "\_type" : "type1", "\_index" : "test",  
> "\_retry\_on\_conflict" : 3} }  
> { "script" : "ctx.\_source.field\_1 : "new content"" }
> 
> curl -XPOST 'localhost:9200/\_bulk?pretty' --data-binary @test.json
> 
> I get the following response, which says that both updates succeeded:
> 
> {  
> "took" : 139,  
> "items" : [ {  
> "index" : {  
> "\_index" : "test",  
> "\_type" : "type1",  
> "\_id" : "1",  
> "\_version" : 1,  
> "ok" : true  
> }  
> }, {  
> "delete" : {  
> "\_index" : "test",  
> "\_type" : "type1",  
> "\_id" : "2",  
> "\_version" : 1,  
> "ok" : true,  
> "found" : false  
> }  
> }, {  
> "create" : {  
> "\_index" : "test",  
> "\_type" : "type1",  
> "\_id" : "3",  
> "\_version" : 1,  
> "ok" : true  
> }  
> }, {  
> "update" : {  
> "\_index" : "test",  
> "\_type" : "type1",  
> "\_id" : "1",  
> "\_version" : 2,  
> "ok" : true  
> }  
> }, {  
> "update" : {  
> "\_index" : "test",  
> "\_type" : "type1",  
> "\_id" : "1",  
> "\_version" : 3,  
> "ok" : true  
> }  
> } ]
> 
> But the data shows the following (What am I doing wrong??):
> 
> {
> 
> - \_index: test
> - \_type: type1
> - \_id: 1
> - \_version: 3
> - \_score: 1
> - \_source: {
> - field\_1: value\_1
> - field\_2: value\_2  
> }
> 
> }
> 
> What am I doing wrong?
> 
> Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:12am UTC](https://discuss.elastic.co/t/es-0-90-5-bulk-update-does-not-seem-to-work-properly/13937/3 "2017-07-06T02:12:40Z")

</div>


