public abstract class FieldOffsetStrategy extends 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 String |
field |
protected PhraseHelper |
phraseHelper |
protected BytesRef[] |
terms |
| Constructor and Description |
|---|
FieldOffsetStrategy(String field,
BytesRef[] queryTerms,
PhraseHelper phraseHelper,
CharacterRunAutomaton[] automata) |
| Modifier and Type | Method and Description |
|---|---|
protected List<OffsetsEnum> |
createAutomataOffsetsFromTerms(Terms termsIndex,
int doc) |
protected List<OffsetsEnum> |
createOffsetsEnumsFromReader(LeafReader leafReader,
int doc) |
String |
getField() |
abstract List<OffsetsEnum> |
getOffsetsEnums(IndexReader reader,
int docId,
String content)
The primary method -- return offsets for highlightable words in the specified document.
|
abstract UnifiedHighlighter.OffsetSource |
getOffsetSource() |
protected final String field
protected final PhraseHelper phraseHelper
protected final BytesRef[] terms
protected final CharacterRunAutomaton[] automata
public FieldOffsetStrategy(String field, BytesRef[] queryTerms, PhraseHelper phraseHelper, CharacterRunAutomaton[] automata)
public String getField()
public abstract UnifiedHighlighter.OffsetSource getOffsetSource()
public abstract List<OffsetsEnum> getOffsetsEnums(IndexReader reader, int docId, String content) throws IOException
IOExceptionprotected List<OffsetsEnum> createOffsetsEnumsFromReader(LeafReader leafReader, int doc) throws IOException
IOExceptionprotected List<OffsetsEnum> createAutomataOffsetsFromTerms(Terms termsIndex, int doc) throws IOException
IOExceptionCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.