Skip to content

Running a getAllIndices call for indices created using the default token_chars parameter throws an error #918

@kved96

Description

@kved96

Java API client version

8.16.1

Java version

17

Elasticsearch Version

8.14.3

Problem description

I'm running into an issue after creating an index with an n_gram tokenizer with the token_chars field when using the below method to get all the indices in the cluster. The specific settings I'm using at create time are:

{
"index.analysis.analyzer.test_ngram_analyzer.tokenizer": "ngram_tokenizer",
"index.analysis.test_ngram_analyzer.filter" : "lowercase",
"index.analysis.test_ngram_analyzer.type": "custom", 
"index.analysis.tokenizer.ngram_tokenizer.type": "ngram",
"index.analysis.tokenizer.ngram_tokenizer.min_gram": 1,
"index.analysis.tokenizer.ngram_tokenizer.max_gram": 2

}

Then using the get indices endpoint like below:

esClient.indices()
                .get(r -> r.index("_all")
                        .allowNoIndices(true)
                        .expandWildcards(ExpandWildcard.Open, ExpandWildcard.Closed))
                .result()

Throws with:

status: 200, [es/indices.get] Failed to decode response","throwable2_message":"Error deserializing co.elastic.clients.elasticsearch._types.analysis.TokenizerDefinition: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'NGramTokenizer.tokenChars' 

I would expect this to be patched by #877, but it doesn't look like it is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions