DateField
@Deprecated public final class LegacyDateField extends DateField
In Solr 1.2, DateField did not enforce the canonical representation of the ISO 8601 format when parsing incoming data, and did not generation the canonical format when generating dates from "Date Math" strings (particularly as it pertains to milliseconds ending in trailing zeros) -- As a result equivalent dates could not always be compared properly.
This class is provided as possible alternative for people who depend on the "broken" behavior of DateField in Solr 1.2 (specificly: accepting any input that ends in a 'Z', and formating DateMath expressions using 3 decimals of milliseconds) while still supporting some newer functionality of DateField (ie: DateMath on explicit strings in addition to "NOW")
Users that desire 100% backwards compatibility should consider using the Solr 1.2 version of DateField
Modifier and Type | Class and Description |
---|---|
private static class |
LegacyDateField.ThreadLocalDateFormat
Deprecated.
|
FieldType.DefaultAnalyzer
Modifier and Type | Field and Description |
---|---|
private static LegacyDateField.ThreadLocalDateFormat |
fmtThreadLocal
Deprecated.
|
CANONICAL_LOCALE, CANONICAL_TZ, MATH_LOCALE, MATH_TZ, NOW, UTC, Z
analyzer, args, falseProperties, log, POLY_FIELD_SEPARATOR, properties, queryAnalyzer, trueProperties, typeName
BINARY, INDEXED, MULTIVALUED, OMIT_NORMS, OMIT_POSITIONS, OMIT_TF_POSITIONS, propertyMap, propertyNames, REQUIRED, SORT_MISSING_FIRST, SORT_MISSING_LAST, STORE_TERMOFFSETS, STORE_TERMPOSITIONS, STORE_TERMVECTORS, STORED, TOKENIZED
Constructor and Description |
---|
LegacyDateField()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
formatDate(java.util.Date d)
Deprecated.
Thread safe method that can be used by subclasses to format a Date
using the Internal representation.
|
protected java.text.DateFormat |
getThreadLocalDateFormat()
Deprecated.
This method returns a DateFormat which does NOT respect the
ISO 8601 canonical format with regards to trailing zeros in milliseconds,
instead if always formats milliseconds to 3 decimal points.
|
java.lang.String |
toInternal(java.lang.String val)
Deprecated.
Overrides the super class to short circut and do no enforcing of
the canonical format
|
formatExternal, getRangeQuery, getSortField, getValueSource, indexedToReadable, parseDate, parseDateLenient, parseMath, parseMathLenient, toExternal, toExternal, toInternal, toObject, toObject, write, write
init
createField, createField, createFields, getAnalyzer, getArg, getFieldIndex, getFieldQuery, getFieldStore, getFieldTermVec, getIndexOptions, getQueryAnalyzer, getRangeQuery, getStringSort, getTypeName, getValueSource, hasProperty, isMultiValued, isPolyField, isTokenized, multiValuedFieldCache, readableToIndexed, restrictProps, setAnalyzer, setArgs, setQueryAnalyzer, setTypeName, storedToIndexed, storedToReadable, toString
getPropertyName, off, on, parseProperties, propertiesToString, propertyNameToInt
private static LegacyDateField.ThreadLocalDateFormat fmtThreadLocal
public java.lang.String toInternal(java.lang.String val)
toInternal
in class DateField
FieldType.toExternal(org.apache.lucene.document.Fieldable)
protected java.text.DateFormat getThreadLocalDateFormat()
getThreadLocalDateFormat
in class DateField
protected java.lang.String formatDate(java.util.Date d)
DateField
formatDate
in class DateField