Skip to content

Missing required property 'KuromojiAnalyzer.mode' #1082

@ag4ta

Description

@ag4ta

Java API client version

8.19.4

Java version

21.0.8

Elasticsearch Version

8.19.4

Problem description

Hi 👋
I’m migrating from the Java High Level REST Client (7.17.23) to the newer elasticsearch-java client (8.19.4).

I encountered the MissingRequiredPropertyException issue while trying to create an index:

Java::CoElasticClientsJson::JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch._types.analysis.Analyzer: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'KuromojiAnalyzer.mode' (JSON path: settings.index.analysis.analyzer.text_ja) (line no=1, column no=76, offset=75)
from co.elastic.clients.json.JsonpMappingException.from0(co/elastic/clients/json/JsonpMappingException.java:134)
Caused by Java::CoElasticClientsUtil::MissingRequiredPropertyException: Missing required property 'KuromojiAnalyzer.mode'
from co.elastic.clients.util.ApiTypeHelper.checkNotNull(ApiTypeHelper.java:81)

Here are settings that throws this exception:

{
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "text_ja": {
            "type": "kuromoji"
          }
        }
      }
    }
  }
}

I tried the workaround described here: troubleshooting/missing-required-property
But it didn’t help and as a result got different exception:

Java::JavaLang::NullPointerException: Cannot invoke "co.elastic.clients.elasticsearch._types.analysis.KuromojiTokenizationMode.serialize(jakarta.json.stream.JsonGenerator, co.elastic.clients.json.JsonpMapper)" because "this.mode" is null
from co.elastic.clients.elasticsearch._types.analysis.KuromojiAnalyzer.serializeInternal(co/elastic/clients/elasticsearch/_types/analysis/KuromojiAnalyzer.java:118)

Could you please fix the issue?
The kuromoji analyzer doesn’t require the mode field (docs here)
But only kuromoji_tokenizer requires it (docs here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client codeCategory: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions