public class ElasticsearchDateBridge extends EncodingStringBridge<Date> implements TwoWayFieldBridge, ParameterizedBridge, IgnoreAnalyzerBridge
java.util.Date
to a String
using the ISO 8601 standard which is the default date format
of Elasticsearch.
UTC is used as time zone.
Typically, a java.util.Date
will be converted to "2016-04-28T15:24:25Z".Modifier and Type | Field and Description |
---|---|
static ElasticsearchDateBridge |
DATE_DAY |
static ElasticsearchDateBridge |
DATE_HOUR |
static ElasticsearchDateBridge |
DATE_MILLISECOND |
static ElasticsearchDateBridge |
DATE_MINUTE |
static ElasticsearchDateBridge |
DATE_MONTH |
static ElasticsearchDateBridge |
DATE_SECOND |
static ElasticsearchDateBridge |
DATE_YEAR |
Constructor and Description |
---|
ElasticsearchDateBridge() |
ElasticsearchDateBridge(Resolution resolution) |
Modifier and Type | Method and Description |
---|---|
Object |
get(String name,
org.apache.lucene.document.Document document) |
String |
objectToString(Object object) |
protected Date |
parseIndexNullAs(String indexNullAs) |
void |
set(String name,
Object value,
org.apache.lucene.document.Document document,
LuceneOptions luceneOptions) |
void |
setParameterValues(Map<String,String> parameters) |
createNullMarker, getEncodingType
public static final ElasticsearchDateBridge DATE_YEAR
public static final ElasticsearchDateBridge DATE_MONTH
public static final ElasticsearchDateBridge DATE_DAY
public static final ElasticsearchDateBridge DATE_HOUR
public static final ElasticsearchDateBridge DATE_MINUTE
public static final ElasticsearchDateBridge DATE_SECOND
public static final ElasticsearchDateBridge DATE_MILLISECOND
public ElasticsearchDateBridge()
public ElasticsearchDateBridge(Resolution resolution)
public void set(String name, Object value, org.apache.lucene.document.Document document, LuceneOptions luceneOptions)
set
in interface FieldBridge
public Object get(String name, org.apache.lucene.document.Document document)
get
in interface TwoWayFieldBridge
public String objectToString(Object object)
objectToString
in interface StringBridge
objectToString
in interface TwoWayFieldBridge
public void setParameterValues(Map<String,String> parameters)
setParameterValues
in interface ParameterizedBridge
protected Date parseIndexNullAs(String indexNullAs) throws IllegalArgumentException
parseIndexNullAs
in class EncodingStringBridge<Date>
IllegalArgumentException
Copyright © 2006–2017 Hibernate. All rights reserved.