Package org.apache.lucene.analysis.sinks
Class DateRecognizerSinkFilter
java.lang.Object
org.apache.lucene.analysis.sinks.TeeSinkTokenFilter.SinkFilter
org.apache.lucene.analysis.sinks.DateRecognizerSinkFilter
Attempts to parse the
CharTermAttribute.buffer() as a Date using a DateFormat.
If the value is a Date, it will add it to the sink.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUsesDateFormat#getDateInstance(DateFormat.DEFAULT, Locale.ROOT)as theDateFormatobject.DateRecognizerSinkFilter(DateFormat dateFormat) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(AttributeSource source) Returns true, iff the current state of the passed-inAttributeSourceshall be stored in the sink.Methods inherited from class org.apache.lucene.analysis.sinks.TeeSinkTokenFilter.SinkFilter
reset
-
Field Details
-
DATE_TYPE
- See Also:
-
-
Constructor Details
-
DateRecognizerSinkFilter
public DateRecognizerSinkFilter()UsesDateFormat#getDateInstance(DateFormat.DEFAULT, Locale.ROOT)as theDateFormatobject. -
DateRecognizerSinkFilter
-
-
Method Details
-
accept
Description copied from class:TeeSinkTokenFilter.SinkFilterReturns true, iff the current state of the passed-inAttributeSourceshall be stored in the sink.- Specified by:
acceptin classTeeSinkTokenFilter.SinkFilter
-