Class MatchHighlighter
java.lang.Object
org.apache.lucene.search.matchhighlight.MatchHighlighter
An example highlighter that combines several lower-level highlighting utilities in this package
into a fully featured, ready-to-use component.
Note that if you need to customize or tweak the details of highlighting, it is better to assemble your own highlighter using those low-level building blocks, rather than extend or modify this one.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Single document's highlights.static interface
Actual per-field highlighter.static class
AnOffsetRange
of a match, together with the source query that caused it. -
Constructor Summary
ConstructorDescriptionMatchHighlighter
(IndexSearcher searcher, Analyzer analyzer) MatchHighlighter
(IndexSearcher searcher, Analyzer analyzer, OffsetsRetrievalStrategySupplier offsetsRetrievalStrategies) -
Method Summary
Modifier and TypeMethodDescriptionvoid
alwaysFetchFields
(String... fields) Always fetch the given set of fields for all input documents.Append a new highlighter to field highlighters chain.
-
Constructor Details
-
MatchHighlighter
-
MatchHighlighter
public MatchHighlighter(IndexSearcher searcher, Analyzer analyzer, OffsetsRetrievalStrategySupplier offsetsRetrievalStrategies)
-
-
Method Details
-
appendFieldHighlighter
Append a new highlighter to field highlighters chain. The order of field highlighters is important (first-matching wins). -
alwaysFetchFields
Always fetch the given set of fields for all input documents. -
highlight
public Stream<MatchHighlighter.DocHighlights> highlight(TopDocs topDocs, Query... queries) throws IOException - Throws:
IOException
-