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 `Token.termBuffer()` as a Date using a `DateFormat`. If the value is a Date, it will add it to the sink.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DATE_TYPE`
    `protected java.text.DateFormat` | `dateFormat`
    `protected org.apache.lucene.analysis.tokenattributes.TermAttribute` | `termAtt`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DateRecognizerSinkFilter()` Uses `DateFormat.getDateInstance()` as the `DateFormat` object.
    `DateRecognizerSinkFilter(java.text.DateFormat dateFormat)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 java.lang.String DATE_TYPE

      See Also:
        Constant Field Values

    - #### dateFormat

          protected java.text.DateFormat dateFormat

    - #### termAtt

          protected org.apache.lucene.analysis.tokenattributes.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(org.apache.lucene.util.AttributeSource source)

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

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