# Problem with example in advanced script engine es 5.6

**URL:** <https://discuss.elastic.co/t/problem-with-example-in-advanced-script-engine-es-5-6/102972>\
**Category:** Elasticsearch\
**Created:** [October 6, 2017, 8:33am UTC](https://discuss.elastic.co/t/problem-with-example-in-advanced-script-engine-es-5-6/102972 "2017-10-06T08:33:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junon\_Lim](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@Junon\_Lim](https://discuss.elastic.co/u/Junon_Lim)\
**Post date:** [October 6, 2017, 8:33am UTC](https://discuss.elastic.co/t/problem-with-example-in-advanced-script-engine-es-5-6/102972/1 "2017-10-06T08:33:50Z")

</div>

I was following the guide below.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-engine.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-engine.html)

The result I got was as below. I was debugging the code and the line "return p -\> new SearchScript()" caused this to happen.

"root\_cause" : [  
{  
"type" : "null\_pointer\_exception",  
"reason" : null  
}  
],  
"type" : "search\_phase\_execution\_exception",  
"reason" : "all shards failed",  
"phase" : "query",  
"grouped" : true,  
"failed\_shards" : [  
{  
"shard" : 0,  
"index" : "experttest",  
"node" : "ERrGuH0sQkq6n0bFcRlPHw",  
"reason" : {  
"type" : "null\_pointer\_exception",  
"reason" : null  
}  
}  
]

---

<div class="post-metadata">

**Author:** ![Junon\_Lim](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@Junon\_Lim](https://discuss.elastic.co/u/Junon_Lim)\
**Post date:** [October 6, 2017, 8:53am UTC](https://discuss.elastic.co/t/problem-with-example-in-advanced-script-engine-es-5-6/102972/2 "2017-10-06T08:53:29Z")

</div>

missing code under "SearchScript search" method. Closed.

---

<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:** [November 3, 2017, 8:53am UTC](https://discuss.elastic.co/t/problem-with-example-in-advanced-script-engine-es-5-6/102972/3 "2017-11-03T08:53:30Z")

</div>

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