opensearch-project / opensearch-java

Java Client for OpenSearch
Apache License 2.0
105 stars 169 forks source link

Default analyzer deserialization to custom type when unspecified #1033

Closed Xtansia closed 1 week ago

Xtansia commented 1 week ago

Description

Fixes an error when deserializing an analyzer without an explicit type specified:

JsonParsingException: Property 'type' not found
    at org.opensearch.client.json.JsonpUtils.lookAheadFieldValue(JsonpUtils.java:145)

The server requires type to be specified unless tokenizer is specified then type: custom is assumed, thus any analyzer without type specified is a custom analyzer.

Issues Resolved

Fixes #1032

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

reta commented 1 week ago

@Xtansia I think the backport worklfows are broken at the moment, could you please do 2.x manually? thank you.