Class JavaExceptionAnalyzer

java.lang.Object
org.apache.lucene.analysis.Analyzer
com.atlassian.jira.issue.index.JavaExceptionAnalyzer
All Implemented Interfaces:
Closeable, AutoCloseable

@Internal public class JavaExceptionAnalyzer extends org.apache.lucene.analysis.Analyzer
This class wraps the given analyzer.

The Analyzer.tokenStream(String, java.io.Reader) method wraps the resulting TokenStream in the SubtokenFilter.

Note: This works on more than just Java exceptions due to the functionality implemented by SubtokenFilter (JRA-7774).

Since:
v3.12 Platform-specific class intended for the Lucene search platform only. Jira Search exposes a common API backed by multiple search engines. This class bypasses that abstraction and couples callers to Lucene internals. Using this class when the runtime search platform is not Lucene (e.g. OpenSearch) may produce incorrect results or failures. Internal use only.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer

    org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents
  • Field Summary

    Fields inherited from class org.apache.lucene.analysis.Analyzer

    GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
  • Constructor Summary

    Constructors
    Constructor
    Description
    JavaExceptionAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
    Constructs a new instance and wraps the given analyzer
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents
    Returns the token stream of the underlying analyzer with ExceptionFilter wrapped around it
    int
     

    Methods inherited from class org.apache.lucene.analysis.Analyzer

    attributeFactory, close, getOffsetGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, normalize, setVersion, tokenStream, tokenStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JavaExceptionAnalyzer

      public JavaExceptionAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
      Constructs a new instance and wraps the given analyzer
      Parameters:
      analyzer - analyzer to wrap
  • Method Details

    • createComponents

      protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName)
      Returns the token stream of the underlying analyzer with ExceptionFilter wrapped around it
      Specified by:
      createComponents in class org.apache.lucene.analysis.Analyzer
      Parameters:
      fieldName - field name
      Returns:
      token stream of the underlying analyzer with ExceptionFilter wrapped around it
    • getPositionIncrementGap

      public int getPositionIncrementGap(String fieldName)
      Overrides:
      getPositionIncrementGap in class org.apache.lucene.analysis.Analyzer