We're updating the issue view to help you get more done. 

ZonedDateTime with zone = ZoneOffset.UTC fails when indexing in Elasticsearch 5.6

Description

There must be something wrong with the format used in ES5.6. This probably affects ES6 too, but ES7 should be fine.

To clarify, this bug only happens when the zone is ZoneOffset.UTC. ZoneId.of("UTC") works fine...

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 15:20:12,869 (Hibernate Search: Elasticsearch transport thread-2) TRACE request:206 - HSEARCH400093: Executed Elasticsearch HTTP PUT request to path '/indexwithcompatiblefields/doc/compatible_1' with query parameters {} and 1 objects in payload in 11ms. Response had status 400 'Bad Request'. Request body: < { "byType_keywordString": "", "byType_analyzedString": "", "byType_normalizedString": "", "byType_Integer": 0, "byType_Float": 0.0, "byType_Long": 0, "byType_Boolean": true, "byType_Byte": 0, "byType_Short": 0, "byType_Double": 0.0, "byType_Instant": "1970-01-01T00:00:00.000000000Z", "byType_LocalDate": "1970-01-01", "byType_LocalDateTime": "1970-01-01T00:00:00.000000000", "byType_LocalTime": "00:00:00.000000000", "byType_ZonedDateTime": "1970-01-01T00:00:00.000000000Z[Z]", "byType_Year": "1980", "byType_YearMonth": "0000-01", "byType_MonthDay": "--01-01", "byType_OffsetDateTime": "1970-01-01T00:00:00.000000000Z", "byType_OffsetTime": "00:00:00.000000000Z", "byType_GeoPoint": { "lat": 0.0, "lon": 0.0 } } >. Response body: < { "error": { "root_cause": [ { "type": "mapper_parsing_exception", "reason": "failed to parse [byType_ZonedDateTime]" } ], "type": "mapper_parsing_exception", "reason": "failed to parse [byType_ZonedDateTime]", "caused_by": { "type": "illegal_argument_exception", "reason": "Invalid format: \"1970-01-01T00:00:00.000000000Z[Z]\" is malformed at \"Z]\"" } }, "status": 400 } >

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

6.0.0.Alpha3

Priority

Major