# Update api and nested fields

**URL:** <https://discuss.elastic.co/t/update-api-and-nested-fields/9925>\
**Category:** Elasticsearch\
**Created:** [December 3, 2012, 9:18pm UTC](https://discuss.elastic.co/t/update-api-and-nested-fields/9925 "2012-12-03T21:18:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_nozzle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the_nozzle/32/1935_2.png) [@the\_nozzle](https://discuss.elastic.co/u/the_nozzle)\
**Post date:** [December 3, 2012, 9:18pm UTC](https://discuss.elastic.co/t/update-api-and-nested-fields/9925/1 "2012-12-03T21:18:07Z")

</div>

For some reason updating nested fields does not work for me : for example  
'{"script": "ctx.\_source.something.nested = new\_name", "params":  
{"new\_name": "test\_hostname"}}' results in nested:  
PropertyAccessException[[Error: could not access: config; in class:  
java.util.LinkedHashMap] ..I am using 0.19.1 .. thanks for any help .

--

---

<div class="post-metadata">

**Author:** ![the\_nozzle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the_nozzle/32/1935_2.png) [@the\_nozzle](https://discuss.elastic.co/u/the_nozzle)\
**Post date:** [December 4, 2012, 12:19am UTC](https://discuss.elastic.co/t/update-api-and-nested-fields/9925/2 "2012-12-04T00:19:00Z")

</div>

minor correction (wrong paste) - [Error: could not access: something; in  
class: java.util.LinkedHashMap]

On Monday, December 3, 2012 1:18:07 PM UTC-8, the\_nozzle wrote:

> For some reason updating nested fields does not work for me : for example  
> '{"script": "ctx.\_source.something.nested = new\_name", "params":  
> {"new\_name": "test\_hostname"}}' results in nested:  
> PropertyAccessException[[Error: could not access: config; in class:  
> java.util.LinkedHashMap] ..I am using 0.19.1 .. thanks for any help .

--

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [December 4, 2012, 6:05am UTC](https://discuss.elastic.co/t/update-api-and-nested-fields/9925/3 "2012-12-04T06:05:06Z")

</div>

Hi,

The error you describe suggests me that the field `something` doesn't  
exist at all. Are you sure that this field is available in the source?

Martijn

On 4 December 2012 11:19, the\_nozzle [k11stan@gmail.com](mailto:k11stan@gmail.com) wrote:

> minor correction (wrong paste) - [Error: could not access: something; in  
> class: java.util.LinkedHashMap]
> 
> On Monday, December 3, 2012 1:18:07 PM UTC-8, the\_nozzle wrote:
> 
> > For some reason updating nested fields does not work for me : for example  
> > '{"script": "ctx.\_source.something.nested = new\_name", "params":  
> > {"new\_name": "test\_hostname"}}' results in nested:  
> > PropertyAccessException[[Error: could not access: config; in class:  
> > java.util.LinkedHashMap] ..I am using 0.19.1 .. thanks for any help .
> 
> --

--  
Met vriendelijke groet,

Martijn van Groningen

--

---

<div class="post-metadata">

**Author:** ![the\_nozzle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the_nozzle/32/1935_2.png) [@the\_nozzle](https://discuss.elastic.co/u/the_nozzle)\
**Post date:** [December 4, 2012, 11:36pm UTC](https://discuss.elastic.co/t/update-api-and-nested-fields/9925/4 "2012-12-04T23:36:30Z")

</div>

Actually I just noticed a typo in the url . Works fine now . Thanks

On Monday, December 3, 2012 10:05:06 PM UTC-8, Martijn v Groningen wrote:

> Hi,
> 
> The error you describe suggests me that the field `something` doesn't  
> exist at all. Are you sure that this field is available in the source?
> 
> Martijn
> 
> On 4 December 2012 11:19, the\_nozzle \<[k11...@gmail.com](mailto:k11...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > minor correction (wrong paste) - [Error: could not access: something; in  
> > class: java.util.LinkedHashMap]
> > 
> > On Monday, December 3, 2012 1:18:07 PM UTC-8, the\_nozzle wrote:
> > 
> > > For some reason updating nested fields does not work for me : for  
> > > example  
> > > '{"script": "ctx.\_source.something.nested = new\_name", "params":  
> > > {"new\_name": "test\_hostname"}}' results in nested:  
> > > PropertyAccessException[[Error: could not access: config; in class:  
> > > java.util.LinkedHashMap] ..I am using 0.19.1 .. thanks for any help .
> > 
> > --
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--

---

<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, 3:01am UTC](https://discuss.elastic.co/t/update-api-and-nested-fields/9925/5 "2017-07-06T03:01:30Z")

</div>


