Class Elasticsearch7DefaultFieldFormatProvider

  • All Implemented Interfaces:
    ElasticsearchDefaultFieldFormatProvider

    public class Elasticsearch7DefaultFieldFormatProvider
    extends Object
    implements ElasticsearchDefaultFieldFormatProvider
    The default field format provider for Elasticsearch 7.

    Elasticsearch 7 and above accept java.time patterns as a format, so we set the format to the same pattern used internally in Hibernate Search.

    We do not use Elasticsearch built-in formats ("strict_date_time", ...) because they do not always match the formatters used in Hibernate Search: for example they sometimes define an offset without a colon, whereas we send offsets with a colon, or a year-of-era (~ absolute value of the year) instead of year (which can be negative).