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 Constructor Description Elasticsearch7DefaultFieldFormatProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeFormattergetDefaultDateTimeFormatter(Class<? extends TemporalAccessor> fieldType)List<String>getDefaultMappingFormat(Class<? extends TemporalAccessor> fieldType)
-
-
-
Method Detail
-
getDefaultDateTimeFormatter
public DateTimeFormatter getDefaultDateTimeFormatter(Class<? extends TemporalAccessor> fieldType)
- Specified by:
getDefaultDateTimeFormatterin interfaceElasticsearchDefaultFieldFormatProvider
-
getDefaultMappingFormat
public List<String> getDefaultMappingFormat(Class<? extends TemporalAccessor> fieldType)
- Specified by:
getDefaultMappingFormatin interfaceElasticsearchDefaultFieldFormatProvider
-
-