|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.postingshighlight.PassageFormatter
public class PassageFormatter
Creates a formatted snippet from the top passages.
The default implementation marks the query terms as bold, and places ellipses between unconnected passages.
Constructor Summary | |
---|---|
PassageFormatter()
Creates a new PassageFormatter with the default tags. |
|
PassageFormatter(String preTag,
String postTag,
String ellipsis)
Creates a new PassageFormatter with custom tags. |
Method Summary | |
---|---|
String |
format(Passage[] passages,
String content)
Formats the top passages from content
into a human-readable text snippet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |