Class FieldValueHighlighters
- java.lang.Object
-
- org.apache.lucene.search.matchhighlight.FieldValueHighlighters
-
public final class FieldValueHighlighters extends Object
A factory ofMatchHighlighter.FieldValueHighlighterclasses that cover typical use cases (verbatim values, highlights, abbreviations).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PassageSelectordefaultPassageSelector()Default preconfiguredPassageSelector.static MatchHighlighter.FieldValueHighlighterhighlighted(int maxPassageWindow, int maxPassages, PassageFormatter passageFormatter, Predicate<String> matchFields)Highlights fields matching predicatematchFieldsonly if they contained query matches.static MatchHighlighter.FieldValueHighlightermaxLeadingCharacters(int maxLeadingCharacters, String ellipsis, Set<String> fields)Displays up tomaxLeadingCharactersof the field's value, regardless of whether it contained highlights or not.static MatchHighlighter.FieldValueHighlighterskipRemaining()Matches all fields and omits their value in the output (so that no highlight or value is emitted).static MatchHighlighter.FieldValueHighlighterverbatimValue(String field, String... moreFields)Always returns raw field values, no highlighting or value truncation is applied.
-
-
-
Method Detail
-
maxLeadingCharacters
public static MatchHighlighter.FieldValueHighlighter maxLeadingCharacters(int maxLeadingCharacters, String ellipsis, Set<String> fields)
Displays up tomaxLeadingCharactersof the field's value, regardless of whether it contained highlights or not.
-
defaultPassageSelector
public static PassageSelector defaultPassageSelector()
Default preconfiguredPassageSelector.
-
highlighted
public static MatchHighlighter.FieldValueHighlighter highlighted(int maxPassageWindow, int maxPassages, PassageFormatter passageFormatter, Predicate<String> matchFields)
Highlights fields matching predicatematchFieldsonly if they contained query matches.
-
verbatimValue
public static MatchHighlighter.FieldValueHighlighter verbatimValue(String field, String... moreFields)
Always returns raw field values, no highlighting or value truncation is applied.
-
skipRemaining
public static MatchHighlighter.FieldValueHighlighter skipRemaining()
Matches all fields and omits their value in the output (so that no highlight or value is emitted).
-
-