I was following the guide below.
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
}
}
]