# Native script name for script.native not detecting in elasticseatch.yml

**URL:** <https://discuss.elastic.co/t/native-script-name-for-script-native-not-detecting-in-elasticseatch-yml/57596>\
**Category:** Elasticsearch\
**Created:** [August 9, 2016, 12:45pm UTC](https://discuss.elastic.co/t/native-script-name-for-script-native-not-detecting-in-elasticseatch-yml/57596 "2016-08-09T12:45:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moni15moni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moni15moni/32/42311_2.png) [@moni15moni](https://discuss.elastic.co/u/moni15moni)\
**Post date:** [August 9, 2016, 12:45pm UTC](https://discuss.elastic.co/t/native-script-name-for-script-native-not-detecting-in-elasticseatch-yml/57596/1 "2016-08-09T12:45:11Z")

</div>

Hi All,

I am trying to migrate the code from elasticsearch-1.7.2 to 2.3.2.

I had given the elasticsearch.yml entry as follows  
"script.native:  
COUNTRY\_MATCH\_SCRIPT.type: com.mnc.es.script.country.ActionScriptFactory" and when tried to run the script query in the code using BooleanQuery, I am getting the exception as follows..

Caused by: ScriptException[Failed to compile inline script [COUNTRY\_MATCH\_SCRIPT] using lang [native]]; nested: IllegalArgumentException[Native script [COUNTRY\_MATCH\_SCRIPT] not found];  
at org.elasticsearch.script.ScriptService.compileInternal(ScriptService.java:313)  
at org.elasticsearch.script.ScriptService.compile(ScriptService.java:257)  
at org.elasticsearch.script.ScriptService.search(ScriptService.java:456)  
at org.elasticsearch.index.query.ScriptQueryParser$ScriptQuery.(ScriptQueryParser.java:130)  
at org.elasticsearch.index.query.ScriptQueryParser.parse(ScriptQueryParser.java:115)  
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:250)  
at org.elasticsearch.index.query.BoolQueryParser.parse(BoolQueryParser.java:82)  
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:250)  
at org.elasticsearch.index.query.IndexQueryParserService.innerParse(IndexQueryParserService.java:320)  
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:223)  
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:218)  
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)  
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:838)  
... 12 more  
Caused by: java.lang.IllegalArgumentException: Native script [COUNTRY\_MATCH\_SCRIPT] not found  
at org.elasticsearch.script.NativeScriptEngineService.compile(NativeScriptEngineService.java:70)  
at org.elasticsearch.script.ScriptService.compileInternal(ScriptService.java:311)  
... 24 more

can anyone pls give any solution for this, where i need to call a script from my existing code.

---

<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 5, 2017, 10:29pm UTC](https://discuss.elastic.co/t/native-script-name-for-script-native-not-detecting-in-elasticseatch-yml/57596/2 "2017-07-05T22:29:05Z")

</div>


