public class DefaultPassageFormatter extends PassageFormatter
The default implementation marks the query terms as bold, and places ellipses between unconnected passages.
| Constructor and Description |
|---|
DefaultPassageFormatter()
Creates a new DefaultPassageFormatter with the default tags.
|
DefaultPassageFormatter(String preTag,
String postTag,
String ellipsis,
boolean escape)
Creates a new DefaultPassageFormatter with custom tags.
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(Passage[] passages,
String content)
Formats the top
passages from content
into a human-readable text snippet. |
public DefaultPassageFormatter()
public DefaultPassageFormatter(String preTag, String postTag, String ellipsis, boolean escape)
preTag - text which should appear before a highlighted term.postTag - text which should appear after a highlighted term.ellipsis - text which should be used to connect two unconnected passages.escape - true if text should be html-escapedpublic String format(Passage[] passages, String content)
PassageFormatterpassages from content
into a human-readable text snippet.format in class PassageFormatterpassages - 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.PostingsHighlighter that
return String, the toString method on the Object
returned by this method is used to compute the string.Copyright © 2010 - 2020 Adobe. All Rights Reserved