Class FieldOffsetStrategy
java.lang.Object
org.apache.lucene.search.uhighlight.FieldOffsetStrategy
- Direct Known Subclasses:
AnalysisOffsetStrategy
,MultiFieldsOffsetStrategy
,NoOpOffsetStrategy
,PostingsOffsetStrategy
,PostingsWithTermVectorsOffsetStrategy
,TermVectorOffsetStrategy
Ultimately returns an
OffsetsEnum
yielding potentially highlightable words in the text.
Needs information about the query up front.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected OffsetsEnum
createOffsetsEnumFromReader
(LeafReader leafReader, int doc) protected void
createOffsetsEnumsForAutomata
(Terms termsIndex, int doc, List<OffsetsEnum> results) protected void
createOffsetsEnumsForTerms
(BytesRef[] sourceTerms, Terms termsIndex, int doc, List<OffsetsEnum> results) protected void
createOffsetsEnumsWeightMatcher
(LeafReader _leafReader, int docId, List<OffsetsEnum> results) getField()
abstract OffsetsEnum
getOffsetsEnum
(LeafReader reader, int docId, String content) The primary method -- return offsets for highlightable words in the specified document.abstract UnifiedHighlighter.OffsetSource
-
Field Details
-
components
-
-
Constructor Details
-
FieldOffsetStrategy
-
-
Method Details
-
getField
-
getOffsetSource
-
getOffsetsEnum
public abstract OffsetsEnum getOffsetsEnum(LeafReader reader, int docId, String content) throws IOException 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
- Throws:
IOException
-
createOffsetsEnumFromReader
protected OffsetsEnum createOffsetsEnumFromReader(LeafReader leafReader, int doc) throws IOException - Throws:
IOException
-
createOffsetsEnumsWeightMatcher
protected void createOffsetsEnumsWeightMatcher(LeafReader _leafReader, int docId, List<OffsetsEnum> results) throws IOException - Throws:
IOException
-
createOffsetsEnumsForTerms
protected void createOffsetsEnumsForTerms(BytesRef[] sourceTerms, Terms termsIndex, int doc, List<OffsetsEnum> results) throws IOException - Throws:
IOException
-
createOffsetsEnumsForAutomata
protected void createOffsetsEnumsForAutomata(Terms termsIndex, int doc, List<OffsetsEnum> results) throws IOException - Throws:
IOException
-