elasticsearch-java icon indicating copy to clipboard operation
elasticsearch-java copied to clipboard

Missing required property 'EnrichConfiguration.range' when asking for enrich policies

Open OlivierRo opened this issue 1 year ago • 0 comments

Java API client version

8.4.0 (but seems to be introduced 8.3.0)

Java version

17

Elasticsearch Version

8.4.0

Problem description

Create an enrich policy with: PUT _enrich/policy/zones2-policy { "match": { "indices": [ "granule"], "match_field": "id", "enrich_fields": ["masks"] } } Java code List<EnrichSummary> policies = client.enrich().getPolicy(p -> p.name("zones2-policy")).policies(); failed with message : Caused by: co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch.enrich.EnrichSummary: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'EnrichConfiguration.range' (JSON path: policies[0].config) (line no=1, column no=124, offset=-1)

This seems to be because EnrichConfiguration.range is mandatory (since 8.3.0) whereas GET _enrich/policy/zones2-policy replies: { "policies": [ { "config": { "match": { "name": "zones2-policy", "indices": [ "granule" ], "match_field": "id", "enrich_fields": [ "masks" ] } } } ] } (without any 'range' property).

OlivierRo avatar Aug 30 '22 15:08 OlivierRo