Class FieldHighlighter
java.lang.Object
org.apache.lucene.search.uhighlight.FieldHighlighter
Internal highlighter abstraction that operates on a per field basis.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final BreakIterator
protected final String
protected final FieldOffsetStrategy
protected final int
protected final int
protected final PassageFormatter
protected final PassageScorer
-
Constructor Summary
ConstructorDescriptionFieldHighlighter
(String field, FieldOffsetStrategy fieldOffsetStrategy, BreakIterator breakIterator, PassageScorer passageScorer, int maxPassages, int maxNoHighlightPassages, PassageFormatter passageFormatter) -
Method Summary
Modifier and TypeMethodDescriptiongetField()
protected Passage[]
getSummaryPassagesNoHighlight
(int maxPassages) Called to summarize a document when no highlights were found.highlightFieldForDoc
(LeafReader reader, int docId, String content) The primary method -- highlight this doc, assuming a specific field and given this content.protected Passage[]
-
Field Details
-
field
-
fieldOffsetStrategy
-
breakIterator
-
passageScorer
-
maxPassages
protected final int maxPassages -
maxNoHighlightPassages
protected final int maxNoHighlightPassages -
passageFormatter
-
-
Constructor Details
-
FieldHighlighter
public FieldHighlighter(String field, FieldOffsetStrategy fieldOffsetStrategy, BreakIterator breakIterator, PassageScorer passageScorer, int maxPassages, int maxNoHighlightPassages, PassageFormatter passageFormatter)
-
-
Method Details
-
getField
-
getOffsetSource
-
highlightFieldForDoc
The primary method -- highlight this doc, assuming a specific field and given this content.- Throws:
IOException
-
getSummaryPassagesNoHighlight
Called to summarize a document when no highlights were found. By default this just returns the firstmaxPassages
sentences; subclasses can override to customize. The state ofbreakIterator
should be at the beginning. -
highlightOffsetsEnums
- Throws:
IOException
-