# Script\_fields giving error

**URL:** https://discuss.elastic.co/t/script-fields-giving-error/23565
**Category:** Elasticsearch
**Created:** [May 6, 2015, 4:26am UTC](https://discuss.elastic.co/t/script-fields-giving-error/23565 "2015-05-06T04:26:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mgarg](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mgarg](https://discuss.elastic.co/u/mgarg)
#### Post date: [May 6, 2015, 4:26am UTC](https://discuss.elastic.co/t/script-fields-giving-error/23565/1 "2015-05-06T04:26:21Z")

</div>

I am using elastic 1.5.0. When I run this block in the query:

"script\_fields" : {  
"test1" : {  
"script" : "doc['actual\_air\_time'].value \* 2",  
"lang":"groovy"  
}  
}

I get an error:

nested: ScriptException[dynamic scripting for [groovy] disabled]

> 

How can I enable groovy script for elastic? Is there any other way to  
evaluate "test1" without using script\_fields?

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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/e7f9f5df-79f8-4ed0-9383-4c5c6e816f04%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e7f9f5df-79f8-4ed0-9383-4c5c6e816f04%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 6, 2015, 5:26am UTC](https://discuss.elastic.co/t/script-fields-giving-error/23565/2 "2015-05-06T05:26:56Z")

</div>

Read this: [Scripting | Elastic Docs](http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#_enabling_dynamic_scripting)

Note that we moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

David

> Le 6 mai 2015 à 06:26, Mohit Garg [mohitgargk@gmail.com](mailto:mohitgargk@gmail.com) a écrit :
> 
> I am using elastic 1.5.0. When I run this block in the query:
> 
> "script\_fields" : {  
> "test1" : {  
> "script" : "doc['actual\_air\_time'].value \* 2",  
> "lang":"groovy"  
> }  
> }
> 
> I get an error:
> 
> > nested: ScriptException[dynamic scripting for [groovy] disabled]
> 
> How can I enable groovy script for elastic? Is there any other way to evaluate "test1" without using script\_fields?
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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/e7f9f5df-79f8-4ed0-9383-4c5c6e816f04%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e7f9f5df-79f8-4ed0-9383-4c5c6e816f04%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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/A1130146-5752-4C31-A623-24F7CD6EE3EA%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/A1130146-5752-4C31-A623-24F7CD6EE3EA%40pilato.fr).  
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:15am UTC](https://discuss.elastic.co/t/script-fields-giving-error/23565/3 "2017-07-06T00:15:33Z")

</div>


