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
FieldType.DefaultAnalyzer
CANONICAL_LOCALE, CANONICAL_TZ, MATH_LOCALE, MATH_TZ, NOW, UTC, Z
analyzer, args, falseProperties, log, POLY_FIELD_SEPARATOR, queryAnalyzer, trueProperties, typeName
BINARY, INDEXED, MULTIVALUED, OMIT_NORMS, OMIT_POSITIONS, OMIT_TF_POSITIONS, 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 String |
formatDate(Date d)
Deprecated.
Thread safe method that can be used by subclasses to format a Date
using the Internal representation.
|
protected 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.
|
String |
toInternal(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, setQueryAnalyzer, storedToIndexed, storedToReadable, toString
public String toInternal(String val)
toInternal
in class DateField
FieldType.toExternal(org.apache.lucene.document.Fieldable)
protected DateFormat getThreadLocalDateFormat()
getThreadLocalDateFormat
in class DateField
protected String formatDate(Date d)
DateField
formatDate
in class DateField