Class Elasticsearch7DefaultFieldFormatProvider
java.lang.Object
org.hibernate.search.backend.elasticsearch.types.format.impl.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).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDefaultDateTimeFormatter(Class<? extends TemporalAccessor> fieldType) getDefaultMappingFormat(Class<? extends TemporalAccessor> fieldType)
-
Constructor Details
-
Elasticsearch7DefaultFieldFormatProvider
public Elasticsearch7DefaultFieldFormatProvider()
-
-
Method Details
-
getDefaultDateTimeFormatter
- Specified by:
getDefaultDateTimeFormatterin interfaceElasticsearchDefaultFieldFormatProvider
-
getDefaultMappingFormat
- Specified by:
getDefaultMappingFormatin interfaceElasticsearchDefaultFieldFormatProvider
-