public class PassageFormatter extends Object
The default implementation marks the query terms as bold, and places ellipses between unconnected passages.
Constructor and Description |
---|
PassageFormatter()
Creates a new PassageFormatter with the default tags.
|
PassageFormatter(String preTag,
String postTag,
String ellipsis)
Creates a new PassageFormatter with custom tags.
|
public PassageFormatter()
public PassageFormatter(String preTag, String postTag, String ellipsis)
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.public String format(Passage[] passages, String content)
passages
from content
into a human-readable text snippet.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.Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.