Class MemoryIndexOffsetStrategy
java.lang.Object
org.apache.lucene.search.uhighlight.FieldOffsetStrategy
org.apache.lucene.search.uhighlight.AnalysisOffsetStrategy
org.apache.lucene.search.uhighlight.MemoryIndexOffsetStrategy
Uses an
Analyzer
on content to get offsets and then populates a MemoryIndex
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LeafReader
private final MemoryIndex
private final CharArrayMatcher
Fields inherited from class org.apache.lucene.search.uhighlight.AnalysisOffsetStrategy
analyzer
Fields inherited from class org.apache.lucene.search.uhighlight.FieldOffsetStrategy
components
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static CharArrayMatcher
buildCombinedAutomaton
(UHComponents components) Build oneCharArrayMatcher
matching any term the query might match.getOffsetsEnum
(LeafReader reader, int docId, String content) The primary method -- return offsets for highlightable words in the specified document.private static FilteringTokenFilter
newKeepWordFilter
(TokenStream tokenStream, CharArrayMatcher matcher) Methods inherited from class org.apache.lucene.search.uhighlight.AnalysisOffsetStrategy
getOffsetSource, tokenStream
Methods inherited from class org.apache.lucene.search.uhighlight.FieldOffsetStrategy
createOffsetsEnumFromReader, createOffsetsEnumsForAutomata, createOffsetsEnumsForTerms, createOffsetsEnumsWeightMatcher, getField
-
Field Details
-
memoryIndex
-
memIndexLeafReader
-
preMemIndexFilterAutomaton
-
-
Constructor Details
-
MemoryIndexOffsetStrategy
-
-
Method Details
-
buildCombinedAutomaton
Build oneCharArrayMatcher
matching any term the query might match. -
getOffsetsEnum
Description copied from class:FieldOffsetStrategy
The primary method -- return offsets for highlightable words in the specified document.Callers are expected to close the returned OffsetsEnum when it has been finished with
- Specified by:
getOffsetsEnum
in classFieldOffsetStrategy
- Throws:
IOException
-
newKeepWordFilter
private static FilteringTokenFilter newKeepWordFilter(TokenStream tokenStream, CharArrayMatcher matcher)
-