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 |
analyzercomponents| 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, tokenStreamcreateOffsetsEnumFromReader, createOffsetsEnumsForAutomata, createOffsetsEnumsForTerms, createOffsetsEnumsWeightMatcher, getFieldprivate 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
FieldOffsetStrategygetOffsetsEnum in class FieldOffsetStrategyjava.io.IOExceptionprivate static FilteringTokenFilter newKeepWordFilter(TokenStream tokenStream, CharacterRunAutomaton charRunAutomaton)