question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error deserializing co.elastic.clients.elasticsearch._types.analysis.Analyzer: Property 'type' not found

See original GitHub issue

Java API client version

8.4.0

Java version

JDK-17

Elasticsearch Version

7.17.2

Problem description

Trying to read settings for an index, throwing Error deserializing co.elastic.clients.elasticsearch._types.analysis.Analyzer: Property 'type' not found Exception


var indexSetting = new GetIndicesSettingsRequest.Builder().index("index_1000").build();

try {
    var settings = elasticSearchClientConfig.getElasticsearchIndicesClient().getSettings(indexSetting);
    System.out.println(settings);
} catch(Exception e) {
    e.printStackTrace();
}

Settings

{
    "index_1000": {
        "settings": {
            "index": {
                "analysis": {
                    "analyzer": {
                        "edgengram-analyzer": {
                            "tokenizer": "edge_ngram_tokenizer"
                        }
                    }
                }
            }
        }
    }
}

Exception trace

Error deserializing co.elastic.clients.elasticsearch._types.analysis.Analyzer: Property 'type' not found (JSON path: index_1000.settings.index.analysis.analyzer['edgengram-analyzer']) (line no=1, column no=56407, offset=-1)

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

3reactions
rockwotjcommented, Oct 26, 2022

FYI I’m able to workaround this via the following (kotlin):

val unwrapped = DelegatingDeserializer.unwrap(Analyzer._DESERIALIZER) as ObjectDeserializer<*>
unwrapped.setTypeProperty("type", "custom")

EDIT: simpler

1reaction
pasupathi-rajamanickam-odpcommented, Oct 26, 2022

Work around Java version, thanks a ton @rockwotj

ObjectDeserializer unwrapped = (ObjectDeserializer) DelegatingDeserializer.unwrap(Analyzer._DESERIALIZER );
unwrapped.setTypeProperty("type", "custom");
Read more comments on GitHub >

github_iconTop Results From Across the Web

Failure with sorts and new co.elastic.clients:elasticsearch-java ...
I am upgrading from Java High-level REST client 7.15 to the new Java client. I am almost done, it seems only one issue...
Read more >
New elasticsearch-java API `CreateIndexRequest` using ...
Seems that the new client requires explicit values for the path hierarchy tokenizer even if they are default. (see default values here )....
Read more >
Normalizer ” + normalizerName + ” not found for field ” + name ...
A detailed guide on how to resolve errors related to "normalizer " + normalizerName + " not found for field " + name...
Read more >
Spring Data Elasticsearch - Reference Documentation
Implements most of the mapping-types available for the index mappings. ... the client. This is not an error in Spring Data Elasticsearch.
Read more >
Hibernate Search 6.1.7.Final: Reference Documentation
The problem, which is not limited to just Hibernate Search, ... the Elasticsearch REST client or retrieve Lucene analyzers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found