Class SnippetFormatter

java.lang.Object
org.apache.lucene.search.uhighlight.PassageFormatter
com.apple.foundationdb.record.lucene.highlight.SnippetFormatter

@API(INTERNAL) public class SnippetFormatter extends org.apache.lucene.search.uhighlight.PassageFormatter
A PassageFormatter which keeps a whole number of words before and after matching text entries to provide context, and inserts ellipses in between matched strings to form a summarized text.

If you want a formatter which returns the whole string, use WholeTextFormatter instead.

  • Constructor Details

  • Method Details

    • format

      public Object format(org.apache.lucene.search.uhighlight.Passage[] passages, String content)
      Specified by:
      format in class org.apache.lucene.search.uhighlight.PassageFormatter