# Unable to update document using a script

**URL:** https://discuss.elastic.co/t/unable-to-update-document-using-a-script/23198
**Category:** Elasticsearch
**Created:** [April 12, 2015, 12:44pm UTC](https://discuss.elastic.co/t/unable-to-update-document-using-a-script/23198 "2015-04-12T12:44:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sacheendra\_Talluri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sacheendra_talluri/32/780_2.png) [@Sacheendra\_Talluri](https://discuss.elastic.co/u/Sacheendra_Talluri)
#### Post date: [April 12, 2015, 12:44pm UTC](https://discuss.elastic.co/t/unable-to-update-document-using-a-script/23198/1 "2015-04-12T12:44:20Z")

</div>

I am unable to update documents using scripts. The required script has been  
stored at config/scripts.  
The curl request I am doing is here

> <https://gist.github.com/sacheendra/22424ca9b3caf1d2a0b1#file-updatedoc_err>

  
The error being returned is:  
{  
"error" : "ActionRequestValidationException[Validation Failed: 1: script  
or doc is missing;]",  
"status" : 400  
}

There is a script in config/scripts named updateDocument.groovy

Is there way to list the scripts in config/scripts to see that my script  
has been recognized by elasticsearch?  
Is updating using a stored script even possible?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a46de672-a1b8-45ce-8aa6-9c6305344ad2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a46de672-a1b8-45ce-8aa6-9c6305344ad2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Sacheendra\_Talluri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sacheendra_talluri/32/780_2.png) [@Sacheendra\_Talluri](https://discuss.elastic.co/u/Sacheendra_Talluri)
#### Post date: [April 12, 2015, 1:11pm UTC](https://discuss.elastic.co/t/unable-to-update-document-using-a-script/23198/2 "2015-04-12T13:11:31Z")

</div>

The script works if used as an indexed script at  
/\_scripts/groovy/updateDocument.

On Sunday, April 12, 2015 at 6:14:20 PM UTC+5:30, Sacheendra Talluri wrote:

> I am unable to update documents using scripts. The required script has  
> been stored at config/scripts.  
> The curl request I am doing is here  
> [Elasticsearch says script is missing, but script is present. · GitHub](https://gist.github.com/sacheendra/22424ca9b3caf1d2a0b1#file-updatedoc_err)  
> The error being returned is:  
> {  
> "error" : "ActionRequestValidationException[Validation Failed: 1: script  
> or doc is missing;]",  
> "status" : 400  
> }
> 
> There is a script in config/scripts named updateDocument.groovy
> 
> Is there way to list the scripts in config/scripts to see that my script  
> has been recognized by elasticsearch?  
> Is updating using a stored script even possible?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e97f5d15-1892-4175-8967-eeeb950448c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e97f5d15-1892-4175-8967-eeeb950448c4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:20am UTC](https://discuss.elastic.co/t/unable-to-update-document-using-a-script/23198/3 "2017-07-06T00:20:12Z")

</div>


