## org.apache.lucene.analysis.sinks
Class DateRecognizerSinkFilter

    java.lang.Object
      org.apache.lucene.analysis.TeeSinkTokenFilter.SinkFilter
          org.apache.lucene.analysis.sinks.DateRecognizerSinkFilter

    public class DateRecognizerSinkFilter

extends org.apache.lucene.analysis.TeeSinkTokenFilter.SinkFilter

Attempts to parse the `CharTermAttributeImpl.termBuffer()` as a Date using a `DateFormat`. If the value is a Date, it will add it to the sink.

Field Summary
`static String` `DATE_TYPE`
`protected DateFormat` `dateFormat`
`protected org.apache.lucene.analysis.tokenattributes.CharTermAttribute` `termAtt`

Constructor Summary
`DateRecognizerSinkFilter()` Uses `DateFormat.getDateInstance()` as the `DateFormat` object.
`DateRecognizerSinkFilter(DateFormat dateFormat)`

Method Summary
`boolean` `accept(org.apache.lucene.util.AttributeSource source)`

Methods inherited from class org.apache.lucene.analysis.TeeSinkTokenFilter.SinkFilter
`reset`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DATE_TYPE

    public static final String DATE_TYPE

See Also:
  Constant Field Values

### dateFormat

    protected DateFormat dateFormat

### termAtt

    protected org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt

Constructor Detail

### DateRecognizerSinkFilter

    public DateRecognizerSinkFilter()

  Uses `DateFormat.getDateInstance()` as the `DateFormat` object.

### DateRecognizerSinkFilter

    public DateRecognizerSinkFilter(DateFormat dateFormat)

Method Detail

### accept

    public boolean accept(org.apache.lucene.util.AttributeSource source)

  Specified by:
    `accept` in class `org.apache.lucene.analysis.TeeSinkTokenFilter.SinkFilter`