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 LeafReaderprivate final MemoryIndexprivate final CharArrayMatcherFields inherited from class org.apache.lucene.search.uhighlight.AnalysisOffsetStrategy
analyzerFields inherited from class org.apache.lucene.search.uhighlight.FieldOffsetStrategy
components -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static CharArrayMatcherbuildCombinedAutomaton(UHComponents components) Build oneCharArrayMatchermatching 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 FilteringTokenFilternewKeepWordFilter(TokenStream tokenStream, CharArrayMatcher matcher) Methods inherited from class org.apache.lucene.search.uhighlight.AnalysisOffsetStrategy
getOffsetSource, tokenStreamMethods 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 oneCharArrayMatchermatching any term the query might match. -
getOffsetsEnum
Description copied from class:FieldOffsetStrategyThe 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:
getOffsetsEnumin classFieldOffsetStrategy- Throws:
IOException
-
newKeepWordFilter
private static FilteringTokenFilter newKeepWordFilter(TokenStream tokenStream, CharArrayMatcher matcher)
-