Class OLucenePerFieldAnalyzerWrapper

java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.AnalyzerWrapper
org.apache.lucene.analysis.DelegatingAnalyzerWrapper
com.orientechnologies.lucene.analyzer.OLucenePerFieldAnalyzerWrapper
All Implemented Interfaces:
Closeable, AutoCloseable

public class OLucenePerFieldAnalyzerWrapper extends org.apache.lucene.analysis.DelegatingAnalyzerWrapper
Created by frank on 10/12/15.

Doesn't allow to wrap components or readers. Thread local resources can be delegated to the delegate analyzer, but not allocated on this analyzer (limit memory consumption). Uses a per field reuse strategy.

  • 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
    OLucenePerFieldAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer)
    Constructs with default analyzer.
    OLucenePerFieldAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer, Map<String,org.apache.lucene.analysis.Analyzer> fieldAnalyzers)
    Constructs with default analyzer and a map of analyzers to use for specific fields.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    add(String field, org.apache.lucene.analysis.Analyzer analyzer)
     
    protected Map<String,org.apache.lucene.analysis.Analyzer>
     
    protected org.apache.lucene.analysis.Analyzer
     
    remove(String field)
     
     

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

    wrapComponents, wrapReader, wrapReaderForNormalization, wrapTokenStreamForNormalization

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

    attributeFactory, createComponents, getOffsetGap, getPositionIncrementGap, initReader, initReaderForNormalization, normalize

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

    close, getReuseStrategy, normalize, tokenStream, tokenStream

    Methods inherited from class java.lang.Object

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

    • OLucenePerFieldAnalyzerWrapper

      public OLucenePerFieldAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer)
      Constructs with default analyzer.
      Parameters:
      defaultAnalyzer - Any fields not specifically defined to use a different analyzer will use the one provided here.
    • OLucenePerFieldAnalyzerWrapper

      public OLucenePerFieldAnalyzerWrapper(org.apache.lucene.analysis.Analyzer defaultAnalyzer, Map<String,org.apache.lucene.analysis.Analyzer> fieldAnalyzers)
      Constructs with default analyzer and a map of analyzers to use for specific fields.
      Parameters:
      defaultAnalyzer - Any fields not specifically defined to use a different analyzer will use the one provided here.
      fieldAnalyzers - a Map (String field name to the Analyzer) to be used for those fields
  • Method Details