org.apache.lucene.search.uhighlight

## Class TermVectorOffsetStrategy

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

-     public class TermVectorOffsetStrategy
      extends FieldOffsetStrategy

  Uses term vectors that contain offsets.
  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Field Summary

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

      `automata, field, phraseHelper, terms`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<OffsetsEnum>` | `getOffsetsEnums(IndexReader reader, int docId, String content)` The primary method -- return offsets for highlightable words in the specified document.
    `UnifiedHighlighter.OffsetSource` | `getOffsetSource()`

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

      `createAutomataOffsetsFromTerms, createOffsetsEnumsFromReader, getField`

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

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

- - ### Constructor Detail

    - #### TermVectorOffsetStrategy

          public TermVectorOffsetStrategy(String field,
                                          BytesRef[] queryTerms,
                                          PhraseHelper phraseHelper,
                                          CharacterRunAutomaton[] automata)

  - ### Method Detail

    - #### getOffsetSource

          public UnifiedHighlighter.OffsetSource getOffsetSource()

      Specified by:
        `getOffsetSource` in class `FieldOffsetStrategy`

    - #### getOffsetsEnums

          public List<OffsetsEnum> getOffsetsEnums(IndexReader reader,
                                                   int docId,
                                                   String content)
                                            throws IOException

      Description copied from class: `FieldOffsetStrategy`
      The primary method -- return offsets for highlightable words in the specified document. IMPORTANT: remember to close them all.
      Specified by:
        `getOffsetsEnums` in class `FieldOffsetStrategy`
      Throws:
        `IOException`

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