1

我正在使用 Elasticsearch 6.8 版。我有一些过滤器查询,其中包含与某些字段匹配正则表达式的存储脚本。脚本如下:

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

现在,当我试图渗透文档时,它会抛出空指针异常。渗滤器查询如下:

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 ",
          }
        }
      }
    }
  }
}

以下是错误:

{ "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 } } }
4

0 回答 0