Skip to content

Error deserializing co.elastic.clients.elasticsearch._types.analysis.HtmlStripCharFilter: Unknown field 'escaped_tags' #528

Closed
@lengoyvaerts

Description

@lengoyvaerts

Java API client version

8.6.2

Java version

17

Elasticsearch Version

8.6.2

Problem description

While trying to create a new index using the Elastic Java Client API, I stumble across the following exception:

Error deserializing co.elastic.clients.elasticsearch._types.analysis.HtmlStripCharFilter: Unknown field 'escaped_tags' (JSON path: settings.index.analysis.char_filter.html_body_filter.escaped_tags)

Code:

public void createIndex(String index, String settingsJson) throws IOException {
  LOG.info("Creating index {}", index);
  CreateIndexRequest request = new CreateIndexRequest.Builder()
                .index(index)
                .withJson(new StringReader(settingsJson))
                .build();
  elasticsearchClient.indices().create(request);
}

where the settings json contains the following:

...
"char_filter": {
  "html_body_filter": {
    "type": "html_strip",
    "escaped_tags": [
      "body"
    ]
  }
}
...

According to the documentation, this is a valid configurable parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions