Class PassageFormatter
- java.lang.Object
-
- org.apache.lucene.search.postingshighlight.PassageFormatter
-
- Direct Known Subclasses:
DefaultPassageFormatter
public abstract class PassageFormatter extends java.lang.Object
Creates a formatted snippet from the top passages.
-
-
Constructor Summary
Constructors Constructor Description PassageFormatter()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.Object
format(Passage[] passages, java.lang.String content)
Formats the toppassages
fromcontent
into a human-readable text snippet.
-
-
-
Method Detail
-
format
public abstract java.lang.Object format(Passage[] passages, java.lang.String content)
Formats the toppassages
fromcontent
into a human-readable text snippet.- 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
PostingsHighlighter
that return String, the toString method on the Object returned by this method is used to compute the string.
-
-