org.apache.lucene.search.vectorhighlight

## Interface FragmentsBuilder

- All Known Implementing Classes:
    BaseFragmentsBuilder, ScoreOrderFragmentsBuilder, SimpleFragmentsBuilder

      public interface FragmentsBuilder

  FragmentsBuilder is an interface for fragments (snippets) builder classes. A FragmentsBuilder class can be plugged in to Highlighter.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `createFragment(org.apache.lucene.index.IndexReader reader, int docId, java.lang.String fieldName, FieldFragList fieldFragList)` create a fragment.
    `java.lang.String[]` | `createFragments(org.apache.lucene.index.IndexReader reader, int docId, java.lang.String fieldName, FieldFragList fieldFragList, int maxNumFragments)` create multiple fragments.

- - ### Method Detail

    - #### createFragment

          java.lang.String createFragment(org.apache.lucene.index.IndexReader reader,
                                          int docId,
                                          java.lang.String fieldName,
                                          FieldFragList fieldFragList)
                                   throws java.io.IOException

      create a fragment.
      Parameters:
        `reader` - IndexReader of the index
        `docId` - document id to be highlighted
        `fieldName` - field of the document to be highlighted
        `fieldFragList` - FieldFragList object
      Returns:
        a created fragment or null when no fragment created
      Throws:
        `java.io.IOException`

    - #### createFragments

          java.lang.String[] createFragments(org.apache.lucene.index.IndexReader reader,
                                             int docId,
                                             java.lang.String fieldName,
                                             FieldFragList fieldFragList,
                                             int maxNumFragments)
                                      throws java.io.IOException

      create multiple fragments.
      Parameters:
        `reader` - IndexReader of the index
        `docId` - document id to be highlighter
        `fieldName` - field of the document to be highlighted
        `fieldFragList` - FieldFragList object
        `maxNumFragments` - maximum number of fragments
      Returns:
        created fragments or null when no fragments created. size of the array can be less than maxNumFragments
      Throws:
        `java.io.IOException`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.