Class TokenStreamOffsetStrategy
java.lang.Object
org.apache.lucene.search.uhighlight.FieldOffsetStrategy
org.apache.lucene.search.uhighlight.AnalysisOffsetStrategy
org.apache.lucene.search.uhighlight.TokenStreamOffsetStrategy
Analyzes the text, producing a single
OffsetsEnum
wrapping the TokenStream
filtered to terms in the query, including wildcards. It can't handle position-sensitive queries
(phrases). Passage accuracy suffers because the freq() is unknown -- it's always Integer.MAX_VALUE
instead.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsFields 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[]
convertTermsToMatchers
(BytesRef[] terms, CharArrayMatcher[] matchers) getOffsetsEnum
(LeafReader reader, int docId, String content) The primary method -- return offsets for highlightable words in the specified document.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
-
combinedAutomata
-
-
Constructor Details
-
TokenStreamOffsetStrategy
-
-
Method Details
-
convertTermsToMatchers
private static CharArrayMatcher[] convertTermsToMatchers(BytesRef[] terms, CharArrayMatcher[] matchers) -
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
-