public class NumericEncodingDateBridge extends Object implements TwoWayFieldBridge, ParameterizedBridge
java.util.Date truncated to the specified resolution to a numerically indexed long.
GMT is used as time zone.
| Modifier and Type | Field and Description |
|---|---|
static TwoWayFieldBridge |
DATE_DAY |
static TwoWayFieldBridge |
DATE_HOUR |
static TwoWayFieldBridge |
DATE_MILLISECOND |
static TwoWayFieldBridge |
DATE_MINUTE |
static TwoWayFieldBridge |
DATE_MONTH |
static TwoWayFieldBridge |
DATE_SECOND |
static TwoWayFieldBridge |
DATE_YEAR |
| Constructor and Description |
|---|
NumericEncodingDateBridge() |
NumericEncodingDateBridge(Resolution resolution) |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(String name,
org.apache.lucene.document.Document document)
Build the element object from the
Document |
org.apache.lucene.document.DateTools.Resolution |
getResolution() |
String |
objectToString(Object object)
Convert the object representation to a string.
|
void |
set(String name,
Object value,
org.apache.lucene.document.Document document,
LuceneOptions luceneOptions)
Manipulate the document to index the given value.
|
void |
setParameterValues(Map<String,String> parameters)
Called on the bridge implementation to pass the parameters.
|
public static final TwoWayFieldBridge DATE_YEAR
public static final TwoWayFieldBridge DATE_MONTH
public static final TwoWayFieldBridge DATE_DAY
public static final TwoWayFieldBridge DATE_HOUR
public static final TwoWayFieldBridge DATE_MINUTE
public static final TwoWayFieldBridge DATE_SECOND
public static final TwoWayFieldBridge DATE_MILLISECOND
public NumericEncodingDateBridge()
public NumericEncodingDateBridge(Resolution resolution)
public Object get(String name, org.apache.lucene.document.Document document)
TwoWayFieldBridgeDocumentget in interface TwoWayFieldBridgename - field namedocument - documentpublic String objectToString(Object object)
TwoWayFieldBridgeobjectToString in interface TwoWayFieldBridgeobject - The object to index.null, but
can be empty.public void set(String name, Object value, org.apache.lucene.document.Document document, LuceneOptions luceneOptions)
FieldBridge
A common implementation is to add a Field with the given name to document following
the parameters luceneOptions if the value is not null.
String fieldValue = convertToString(value);
luceneOptions.addFieldToDocument(name, fieldValue, document);
set in interface FieldBridgename - The field to add to the Lucene documentvalue - The actual value to indexdocument - The Lucene document into which we want to index the value.luceneOptions - Contains the parameters used for adding value to
the Lucene document.public void setParameterValues(Map<String,String> parameters)
ParameterizedBridgesetParameterValues in interface ParameterizedBridgeparameters - map containing string based parameters to be passed to the parameterized bridge. The map is never
null.public org.apache.lucene.document.DateTools.Resolution getResolution()
Copyright © 2006–2015 Hibernate. All rights reserved.