1

I am using Elasticsearch version 6.8. I have some percolator queries containing stored scripts which matches a regular expression against some fields. Scripts are like below:

{
  "_id" : "05441b99218d27e831414b4584ef628e",
  "found" : true,
  "script" : {
    "lang" : "painless",
    "source" : """Pattern p = /the\s+web\S*/i;return  p.matcher(params._source.summary).find();"""
  }
}

Now when I am trying to percolate a document, its throwing null pointer exception. Percolator query is below:

GET mp_percolator_v9_2/doc/_search
{
  "sort": [
    {
      "folderId": "asc"
    }
  ],
  "_source": [
    "customerNumber",
    "deliverySetId",
    "folderId"
  ],
  "query": {
    "bool": {
      "must": {
        "percolate": {
          "field": "query",
          "document": {     
            "summary": " go to the state healthe websites ",
          }
        }
      }
    }
  }
}

Below is the error:

{ "shard" : 1, "index" : "mp_percolator_v9_2", "node" : "o7tCbLC4T9GT61LLS5dcXw", "reason" : { "type" : "script_exception", "reason" : "runtime error", "script_stack" : [ "return p.matcher(params._source.summary).find();", " ^---- HERE" ], "script" : "05441b99218d27e831414b4584ef628e", "lang" : "painless", "caused_by" : { "type" : "null_pointer_exception", "reason" : null } } }

0 Answers0