| Hi Florian Courtial, As you probably read above, this is a bug in Elasticsearch 2.4.1 and 5.0. We are trying to make it solved upstream, but unfortunately it's not entirely in our hands. You're right in saying that overriding the mapping generation is not supported yet. We may add this in Hibernate Search 6.0, where we'll make the internals of Hibernate Search more suitable for non-traditional backends. That's one reason why Elasticsearch support is currently experimental. Your options right now are: 1. Downgrading to a working ES version (2.3.x is known to be unaffected, 2.4.0 hasn't been tested) 2. Waiting for us to release a Hibernate Search version with a built-in workaround (the next version will be 5.6.0.CR1, and will not happen before a few weeks), or for Elastic to release an Elasticsearch version with a fix (no ETA, since Joda Time hasn't even been released with the fix yet) 3. Indexing a non-zoned date/time Since 1. and 2. are probably unacceptable, I'll detail solution 3. You have to add a getter that converts your ZonedDateTime into a OffsetDateTime, and index this getter:
private ZonedDateTime myDate;
public ZonedDateTime getMyDate() {
return myDate;
}
@Field(name = "myDate")
public OffsetDateTime getMyDateWithoutZone() {
return myDate == null ? null : myDate.toOffsetDateTime();
}
Let me know if there's any trouble. |