Class FieldValueHighlighters
java.lang.Object
org.apache.lucene.search.matchhighlight.FieldValueHighlighters
A factory of
MatchHighlighter.FieldValueHighlighter classes that
cover typical use cases (verbatim values, highlights, abbreviations).- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic PassageSelectorDefault preconfiguredPassageSelector.highlighted(int maxPassageWindow, int maxPassages, PassageFormatter passageFormatter, Predicate<String> matchFields) Highlights fields matching predicatematchFieldsonly if they contained query matches.maxLeadingCharacters(int maxLeadingCharacters, String ellipsis, Set<String> fields) Displays up tomaxLeadingCharactersof the field's value, regardless of whether it contained highlights or not.Matches all fields and omits their value in the output (so that no highlight or value is emitted).verbatimValue(String field, String... moreFields) Always returns raw field values, no highlighting or value truncation is applied.
-
Method Details
-
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
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
Matches all fields and omits their value in the output (so that no highlight or value is emitted).
-