Class CustomPassageFormatter
- java.lang.Object
-
- org.apache.lucene.search.uhighlight.PassageFormatter
-
- org.apache.lucene.search.uhighlight.CustomPassageFormatter
-
public class CustomPassageFormatter extends PassageFormatter
-
-
Constructor Summary
Constructors Constructor Description CustomPassageFormatter(String preTag, String postTag, Encoder encoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Snippet[]format(Passage[] passages, String content)Formats the toppassagesfromcontentinto a human-readable text snippet.
-
-
-
Method Detail
-
format
public Snippet[] format(Passage[] passages, String content)
Description copied from class:PassageFormatterFormats the toppassagesfromcontentinto a human-readable text snippet.- Specified by:
formatin classPassageFormatter- Parameters:
passages- top-N passages for the field. Note these are sorted in the order that they appear in the document for convenience.content- content for the field.- Returns:
- formatted highlight. Note that for the
non-expert APIs in
UnifiedHighlighterthat return String, the toString method on the Object returned by this method is used to compute the string.
-
-