8.14.0 Migration : Unknown field 'preserve_original'

Hi,

I am trying to migrate to version 8.14.0.
In my filter mapping, I have the following filter :

"leadingZeroTrim": 
{
  "type": "pattern_replace",
  "preserve_original": "true",
  "pattern": "^0+(.*)",
  "replacement": "$1"
}

It didn't cause any errors in versions before 8.14.0, although it seems that the preserve_original field doesn't work with the pattern_replace type.

It is from version 8.14.0 that this mapping returns an error when using the PutTemplateRequest.Builder().withJson(java.io.Reader) method.

The error is :

co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch._types.analysis.PatternReplaceTokenFilter: Unknown field 'preserve_original'

Can you confirm that this error is indeed the expected behavior ?
If so, how to reproduce the behavior of the field preserve_original in my filter ?

Thank you in advance !

Hello! I went back as far as 7.15, but I cannot find a version of PatternReplaceTokenFilter which supported the preserve_original parameter. The API for filters is one of those in the elasticsearch server which can accept any parameter, for example this request works perfectly fine:

GET /_analyze
{
  "tokenizer": "whitespace",
  "filter": [
    {
      "type": "pattern_replace",
      "pattern": "(dog)",
      "replacement": "watch$1",
      "anything" : "really!"
    }
  ],
  "text": "foxes jump lazy dogs"
}

So I'm suspecting preserve_original wasn't supported, but was accepted anyways, unless it's an even older version that the ones I checked.

Could you let me know which version are you trying to migrate from?

Hello, I am talking about the Elasticsearch Java API Client :

<dependency>
    <groupId>co.elastic.clients</groupId>
    <artifactId>elasticsearch-java</artifactId>
    <version>8.14.0</version>
</dependency>

I apologize for not making this clear from the start!
I am trying to migrate from 8.10.2 to 8.15.0, but it seems that the problem appears from 8.14.0.

Then, if the preserve_original field is not allowed with the pattern_replace type, how are we supposed to do ?

Removed language-clients