public class MemoryIndexOffsetStrategy extends AnalysisOffsetStrategy
Analyzer
on content to get offsets and then populates a MemoryIndex
.Modifier and Type | Field and Description |
---|---|
private LeafReader |
memIndexLeafReader |
private MemoryIndex |
memoryIndex |
private CharacterRunAutomaton |
preMemIndexFilterAutomaton |
analyzer
components
Constructor and Description |
---|
MemoryIndexOffsetStrategy(UHComponents components,
Analyzer analyzer) |
Modifier and Type | Method and Description |
---|---|
private static CharacterRunAutomaton |
buildCombinedAutomaton(UHComponents components)
Build one
CharacterRunAutomaton matching any term the query might match. |
OffsetsEnum |
getOffsetsEnum(LeafReader reader,
int docId,
java.lang.String content)
The primary method -- return offsets for highlightable words in the specified document.
|
private static FilteringTokenFilter |
newKeepWordFilter(TokenStream tokenStream,
CharacterRunAutomaton charRunAutomaton) |
getOffsetSource, tokenStream
createOffsetsEnumFromReader, createOffsetsEnumsForAutomata, createOffsetsEnumsForTerms, createOffsetsEnumsWeightMatcher, getField
private final MemoryIndex memoryIndex
private final LeafReader memIndexLeafReader
private final CharacterRunAutomaton preMemIndexFilterAutomaton
public MemoryIndexOffsetStrategy(UHComponents components, Analyzer analyzer)
private static CharacterRunAutomaton buildCombinedAutomaton(UHComponents components)
CharacterRunAutomaton
matching any term the query might match.public OffsetsEnum getOffsetsEnum(LeafReader reader, int docId, java.lang.String content) throws java.io.IOException
FieldOffsetStrategy
getOffsetsEnum
in class FieldOffsetStrategy
java.io.IOException
private static FilteringTokenFilter newKeepWordFilter(TokenStream tokenStream, CharacterRunAutomaton charRunAutomaton)