Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snowball token filter with default language breaks indices.get() #826

Closed
fabriziofortino opened this issue Jun 3, 2024 · 1 comment
Closed
Labels
Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working

Comments

@fabriziofortino
Copy link
Contributor

Java API client version

8.13.4

Java version

17

Elasticsearch Version

8.13.4

Problem description

I have an index using an analyzer that contains a snowball token filter without specifying the language. This should default to English.

  "snowball_4": {
    "type": "snowball"
  }

indices.get() request fails with the following Exception:

Exception in thread "main" co.elastic.clients.transport.TransportException: node: https://es-host/, status: 200, [es/indices.get] Failed to decode response
        at co.elastic.clients.transport.ElasticsearchTransportBase.decodeTransportResponse(ElasticsearchTransportBase.java:404)
        at co.elastic.clients.transport.ElasticsearchTransportBase.getApiResponse(ElasticsearchTransportBase.java:363)
        at co.elastic.clients.transport.ElasticsearchTransportBase.performRequest(ElasticsearchTransportBase.java:147)
        at co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient.get(ElasticsearchIndicesClient.java:965)
        at co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient.get(ElasticsearchIndicesClient.java:981)
Caused by: co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch._types.analysis.TokenFilterDefinition: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'SnowballTokenFilter.language' (JSON path: ['my-index'].settings.index.analysis.filter.snowball_4) (line no=1, column no=13286, offset=-1)
        at co.elastic.clients.json.JsonpMappingException.from0(JsonpMappingException.java:134)
        at co.elastic.clients.json.JsonpMappingException.from(JsonpMappingException.java:121)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:218)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:148)
        at co.elastic.clients.json.BuildFunctionDeserializer.deserialize(BuildFunctionDeserializer.java:53)
        at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:48)
        at co.elastic.clients.json.UnionDeserializer$SingleMemberHandler.deserialize(UnionDeserializer.java:75)
        at co.elastic.clients.json.UnionDeserializer.deserialize(UnionDeserializer.java:304)
        at co.elastic.clients.json.UnionDeserializer.deserialize(UnionDeserializer.java:259)
        at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
        at co.elastic.clients.json.JsonpDeserializerBase$StringMapDeserializer.deserialize(JsonpDeserializerBase.java:349)
        at co.elastic.clients.json.JsonpDeserializerBase$StringMapDeserializer.deserialize(JsonpDeserializerBase.java:333)
        at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:77)
        at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:78)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:192)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:148)
        at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:77)
        at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:79)
        at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
        at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:78)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:192)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:148)
        at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:77)
        at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:79)
        at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
        at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:78)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:192)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:148)
        at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:77)
        at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:79)
        at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
        at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:78)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:192)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:148)
        at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:77)
        at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:79)
        at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
        at co.elastic.clients.json.JsonpDeserializerBase$StringMapDeserializer.deserialize(JsonpDeserializerBase.java:349)
        at co.elastic.clients.json.JsonpDeserializerBase$StringMapDeserializer.deserialize(JsonpDeserializerBase.java:333)
        at co.elastic.clients.elasticsearch.indices.GetIndexResponse.lambda$createGetIndexResponseDeserializer$0(GetIndexResponse.java:184)
        at co.elastic.clients.json.JsonpDeserializer$3.deserialize(JsonpDeserializer.java:136)
        at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:77)
        at co.elastic.clients.transport.ElasticsearchTransportBase.decodeTransportResponse(ElasticsearchTransportBase.java:399)
        ... 16 more
Caused by: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'SnowballTokenFilter.language'
        at co.elastic.clients.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:76)
        at co.elastic.clients.elasticsearch._types.analysis.SnowballTokenFilter.<init>(SnowballTokenFilter.java:66)
        at co.elastic.clients.elasticsearch._types.analysis.SnowballTokenFilter.<init>(SnowballTokenFilter.java:58)
        at co.elastic.clients.elasticsearch._types.analysis.SnowballTokenFilter$Builder.build(SnowballTokenFilter.java:131)
        at co.elastic.clients.elasticsearch._types.analysis.SnowballTokenFilter$Builder.build(SnowballTokenFilter.java:104)
        at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:80)
        at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
        at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:78)
        at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:209)
        ... 56 more

@l-trotta l-trotta added Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working labels Jun 3, 2024
@l-trotta
Copy link
Contributor

l-trotta commented Jun 3, 2024

Hello, thank you for reporting this! Yes the language field should be optional, we'll fix this in the API specification used to produce the Java code and then regenerate the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants