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 |
strictPhrases |
protected BytesRef[] |
terms |
Constructor and Description |
---|
FieldOffsetStrategy(String field,
BytesRef[] queryTerms,
PhraseHelper phraseHelper,
CharacterRunAutomaton[] automata) |
Modifier and Type | Method and Description |
---|---|
protected OffsetsEnum |
createOffsetsEnumFromTokenStream(int doc,
TokenStream tokenStream) |
protected List<OffsetsEnum> |
createOffsetsEnums(LeafReader leafReader,
int doc,
TokenStream tokenStream) |
protected List<OffsetsEnum> |
createOffsetsEnumsFromReader(LeafReader atomicReader,
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 BytesRef[] terms
protected PhraseHelper strictPhrases
protected 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
IOException
protected List<OffsetsEnum> createOffsetsEnums(LeafReader leafReader, int doc, TokenStream tokenStream) throws IOException
IOException
protected List<OffsetsEnum> createOffsetsEnumsFromReader(LeafReader atomicReader, int doc) throws IOException
IOException
protected OffsetsEnum createOffsetsEnumFromTokenStream(int doc, TokenStream tokenStream) throws IOException
IOException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.