Class PreanalyzedTokenStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class PreanalyzedTokenStream
    extends org.apache.lucene.analysis.TokenStream
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource

        org.apache.lucene.util.AttributeSource.State
    • Field Summary

      • Fields inherited from class org.apache.lucene.analysis.TokenStream

        DEFAULT_TOKEN_ATTRIBUTE_FACTORY
    • Constructor Summary

      Constructors 
      Constructor Description
      PreanalyzedTokenStream​(org.elasticsearch.xcontent.XContentParser parser)
      Creates a PreAnalyzedTokenStream which converts a JSON-serialization of a TokenStream to an actual TokenStream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean incrementToken()  
      void reset()
      Creates a new parser reading the input data and sets the parser state right to the beginning of the actual token list.
      • Methods inherited from class org.apache.lucene.analysis.TokenStream

        close, end
      • Methods inherited from class org.apache.lucene.util.AttributeSource

        addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
    • Constructor Detail

      • PreanalyzedTokenStream

        public PreanalyzedTokenStream​(org.elasticsearch.xcontent.XContentParser parser)
                               throws IOException

        Creates a PreAnalyzedTokenStream which converts a JSON-serialization of a TokenStream to an actual TokenStream.

        The accepted JSON format is that of the Solr JsonPreAnalyzed format (see reference below).

        Parameters:
        parser - - The whole serialized field data, including version, the data to store and, of course, the list of tokens.
        Throws:
        IOException
        See Also:
        http ://wiki.apache.org/solr/JsonPreAnalyzedParser
    • Method Detail

      • incrementToken

        public final boolean incrementToken()
                                     throws IOException
        Specified by:
        incrementToken in class org.apache.lucene.analysis.TokenStream
        Throws:
        IOException
      • reset

        public void reset()
                   throws IOException
        Creates a new parser reading the input data and sets the parser state right to the beginning of the actual token list.
        Overrides:
        reset in class org.apache.lucene.analysis.TokenStream
        Throws:
        IOException