# Partial update using script and updating other properties

**URL:** https://discuss.elastic.co/t/partial-update-using-script-and-updating-other-properties/116294
**Category:** Elasticsearch
**Created:** [January 19, 2018, 7:27pm UTC](https://discuss.elastic.co/t/partial-update-using-script-and-updating-other-properties/116294 "2018-01-19T19:27:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![elpaisa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elpaisa/32/27732_2.png) [@elpaisa](https://discuss.elastic.co/u/elpaisa)
#### Post date: [January 19, 2018, 7:27pm UTC](https://discuss.elastic.co/t/partial-update-using-script-and-updating-other-properties/116294/1 "2018-01-19T19:27:50Z")

</div>

Hi, i read the docs about update API using scripting, but it seems that i can only execute a doc update or script, but how do i update one property using script and the rest of the document assigning values, within the same request?

I tried this without success:

```
{ 
	"script" : "ctx._source.processed += count", 
	"params" : { 
		"count" : 15
	},
	"upsert": {
		"processed": 0,
		"attr1": 1,
		"attr2": 2
	}
}
```

---

<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: [February 16, 2018, 7:28pm UTC](https://discuss.elastic.co/t/partial-update-using-script-and-updating-other-properties/116294/2 "2018-02-16T19:28:14Z")

</div>

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