org.apache.solr.schema
Class LegacyDateField

java.lang.Object
  extended by org.apache.solr.schema.FieldProperties
      extended by org.apache.solr.schema.FieldType
          extended by org.apache.solr.schema.DateField
              extended by org.apache.solr.schema.LegacyDateField

Deprecated. use DateField

@Deprecated
public final class LegacyDateField
extends DateField

This class is NOT recommended for new users and should be considered UNSUPPORTED.

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

See Also:
SOLR-552, SOLR-470, SOLR-521

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.solr.schema.FieldType
FieldType.DefaultAnalyzer
 
Field Summary
 
Fields inherited from class org.apache.solr.schema.DateField
CANONICAL_LOCALE, CANONICAL_TZ, MATH_LOCALE, MATH_TZ, NOW, UTC, Z
 
Fields inherited from class org.apache.solr.schema.FieldType
analyzer, args, falseProperties, log, POLY_FIELD_SEPARATOR, queryAnalyzer, trueProperties, typeName
 
Fields inherited from class org.apache.solr.schema.FieldProperties
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 Summary
LegacyDateField()
          Deprecated.  
 
Method Summary
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
 
Methods inherited from class org.apache.solr.schema.DateField
formatExternal, getRangeQuery, getSortField, getValueSource, indexedToReadable, init, parseDate, parseDateLenient, parseMath, parseMathLenient, toExternal, toExternal, toInternal, toObject, toObject, write, write
 
Methods inherited from class org.apache.solr.schema.FieldType
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LegacyDateField

public LegacyDateField()
Deprecated. 
Method Detail

toInternal

public String toInternal(String val)
Deprecated. 
Overrides the super class to short circut and do no enforcing of the canonical format

Overrides:
toInternal in class DateField
See Also:
FieldType.toExternal(org.apache.lucene.document.Fieldable)

getThreadLocalDateFormat

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.

Overrides:
getThreadLocalDateFormat in class DateField

formatDate

protected String formatDate(Date d)
Deprecated. 
Description copied from class: DateField
Thread safe method that can be used by subclasses to format a Date using the Internal representation.

Overrides:
formatDate in class DateField


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.