public abstract class FieldOffsetStrategy
extends java.lang.Object
OffsetsEnum
yielding potentially highlightable words in the text. Needs
information about the query up front.Modifier and Type | Field and Description |
---|---|
protected CharacterRunAutomaton[] |
automata |
protected java.lang.String |
field |
protected PhraseHelper |
phraseHelper |
protected BytesRef[] |
terms |
Constructor and Description |
---|
FieldOffsetStrategy(java.lang.String field,
BytesRef[] queryTerms,
PhraseHelper phraseHelper,
CharacterRunAutomaton[] automata) |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<OffsetsEnum> |
createAutomataOffsetsFromTerms(Terms termsIndex,
int doc) |
protected java.util.List<OffsetsEnum> |
createOffsetsEnumsFromReader(LeafReader leafReader,
int doc) |
java.lang.String |
getField() |
abstract java.util.List<OffsetsEnum> |
getOffsetsEnums(IndexReader reader,
int docId,
java.lang.String content)
The primary method -- return offsets for highlightable words in the specified document.
|
abstract UnifiedHighlighter.OffsetSource |
getOffsetSource() |
protected final java.lang.String field
protected final PhraseHelper phraseHelper
protected final BytesRef[] terms
protected final CharacterRunAutomaton[] automata
public FieldOffsetStrategy(java.lang.String field, BytesRef[] queryTerms, PhraseHelper phraseHelper, CharacterRunAutomaton[] automata)
public java.lang.String getField()
public abstract UnifiedHighlighter.OffsetSource getOffsetSource()
public abstract java.util.List<OffsetsEnum> getOffsetsEnums(IndexReader reader, int docId, java.lang.String content) throws java.io.IOException
java.io.IOException
protected java.util.List<OffsetsEnum> createOffsetsEnumsFromReader(LeafReader leafReader, int doc) throws java.io.IOException
java.io.IOException
protected java.util.List<OffsetsEnum> createAutomataOffsetsFromTerms(Terms termsIndex, int doc) throws java.io.IOException
java.io.IOException
Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.