## 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 TeeSinkTokenFilter.SinkFilter

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

Field Summary
`static java.lang.String` `DATE_TYPE`
`protected java.text.DateFormat` `dateFormat`
`protected TermAttribute` `termAtt`

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

Method Summary
`boolean` `accept(AttributeSource source)` Returns true, iff the current state of the passed-in `AttributeSource` shall be stored in the sink.

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 java.lang.String DATE_TYPE

See Also:
  Constant Field Values

### dateFormat

    protected java.text.DateFormat dateFormat

### termAtt

    protected TermAttribute termAtt

Constructor Detail

### DateRecognizerSinkFilter

    public DateRecognizerSinkFilter()

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

### DateRecognizerSinkFilter

    public DateRecognizerSinkFilter(java.text.DateFormat dateFormat)

Method Detail

### accept

    public boolean accept(AttributeSource source)

  Description copied from class: `TeeSinkTokenFilter.SinkFilter`
  Returns true, iff the current state of the passed-in `AttributeSource` shall be stored in the sink.

  Specified by:
    `accept` in class `TeeSinkTokenFilter.SinkFilter`

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