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 OffsetsEnum |
createOffsetsEnumFromReader(LeafReader leafReader,
int doc) |
protected void |
createOffsetsEnumsForAutomata(Terms termsIndex,
int doc,
List<OffsetsEnum> results) |
protected void |
createOffsetsEnumsForTerms(BytesRef[] sourceTerms,
Terms termsIndex,
int doc,
List<OffsetsEnum> results) |
String |
getField() |
abstract OffsetsEnum |
getOffsetsEnum(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 OffsetsEnum getOffsetsEnum(IndexReader reader, int docId, String content) throws IOException
IOException
protected OffsetsEnum createOffsetsEnumFromReader(LeafReader leafReader, int doc) throws IOException
IOException
protected void createOffsetsEnumsForTerms(BytesRef[] sourceTerms, Terms termsIndex, int doc, List<OffsetsEnum> results) throws IOException
IOException
protected void createOffsetsEnumsForAutomata(Terms termsIndex, int doc, List<OffsetsEnum> results) throws IOException
IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.