Plainess regex enagle

Hi,

I have "script.painless.regex.enabled: true" at elasticsearch.yml and trying to use some additional regex features (Pattern.compile) in plainness but it still seems not to allow it. I am testing within the cloud which should be 8.5.

what I am trying to do in ingest + plainness:

The following works:

"set": {
        "if": "Pattern p = /a*b/; Matcher m = p.matcher('aaaab') ; m.matches()",
        "field": "somefield",
        "value": "{{{somevaluevalues}}}",
}

With Pattern.compile returned error:

"set": {
        "if": "Pattern p = Pattern.compile('a*b') ; Matcher m = p.matcher('aaaab') ; m.matches() ",
        "field": "somefield",
        "value": "{{{somevaluevalues}}}",
}

the error I got
"type": "illegal_argument_exception",
"reason": "static method [java.util.regex.Pattern, compile/1] not found"

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