org.apache.lucene.search.uhighlight

## Class AnalysisOffsetStrategy

- java.lang.Object
- - org.apache.lucene.search.uhighlight.FieldOffsetStrategy
  - - org.apache.lucene.search.uhighlight.AnalysisOffsetStrategy

- Direct Known Subclasses:
    MemoryIndexOffsetStrategy, TokenStreamOffsetStrategy

      public abstract class AnalysisOffsetStrategy
      extends FieldOffsetStrategy

  Provides a base class for analysis based offset strategies to extend from. Requires an Analyzer and provides an override-able method for altering how the TokenStream is created.
  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Analyzer` | `analyzer`

    - ### Fields inherited from class org.apache.lucene.search.uhighlight.FieldOffsetStrategy

      `automata, field, phraseHelper, terms`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnalysisOffsetStrategy(String field, BytesRef[] queryTerms, PhraseHelper phraseHelper, CharacterRunAutomaton[] automata, Analyzer analyzer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `UnifiedHighlighter.OffsetSource` | `getOffsetSource()`
    `protected TokenStream` | `tokenStream(String content)`

    - ### Methods inherited from class org.apache.lucene.search.uhighlight.FieldOffsetStrategy

      `createAutomataOffsetsFromTerms, createOffsetsEnumsFromReader, getField, getOffsetsEnums`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### analyzer

          protected final Analyzer analyzer

  - ### Constructor Detail

    - #### AnalysisOffsetStrategy

          public AnalysisOffsetStrategy(String field,
                                        BytesRef[] queryTerms,
                                        PhraseHelper phraseHelper,
                                        CharacterRunAutomaton[] automata,
                                        Analyzer analyzer)

  - ### Method Detail

    - #### getOffsetSource

          public final UnifiedHighlighter.OffsetSource getOffsetSource()

      Specified by:
        `getOffsetSource` in class `FieldOffsetStrategy`

    - #### tokenStream

          protected TokenStream tokenStream(String content)
                                     throws IOException

      Throws:
        `IOException`

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