Skip to content

co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'PatternTokenizer.flags' #418

Closed
@grib0

Description

@grib0

Java API client version

7.17.2

Java version

17

Elasticsearch Version

7.17.0

Problem description

Using the java client api, I'm unable to create an index with a this mapping

    "settings": {
        "analysis": {
            "tokenizer": {
                "espaceTiretTokenizer": {
                    "type": "pattern",
                    "pattern": "[\\s,/\\\\-]+"
                }
            }
        }
    }
}
elasticsearchClient.indices()
            .create(c -> c.index(adresseIndex)
            .withJson("settings loaded here")

I got :
co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'PatternTokenizer.flags'

Trying to add
ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true); as explained in the doc https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/7.17/missing-required-property.html results in
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "co.elastic.clients.util.ApiTypeHelper.requireNonNull(Object, Object, String)" is null

The workaround is to add the 2 properties flags and group but this properties should be optional

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions