## org.apache.lucene.search.vectorhighlight
Class BaseFragmentsBuilder

    java.lang.Object
      org.apache.lucene.search.vectorhighlight.BaseFragmentsBuilder

All Implemented Interfaces:
  FragmentsBuilder

Direct Known Subclasses:
  ScoreOrderFragmentsBuilder, SimpleFragmentsBuilder

    public abstract class BaseFragmentsBuilder

extends java.lang.Object
implements FragmentsBuilder

Field Summary
`static java.lang.String[]` `COLORED_POST_TAGS`
`static java.lang.String[]` `COLORED_PRE_TAGS`
`protected java.lang.String[]` `postTags`
`protected java.lang.String[]` `preTags`

Constructor Summary
`protected` `BaseFragmentsBuilder()`
`protected` `BaseFragmentsBuilder(java.lang.String[] preTags, java.lang.String[] postTags)`

Method Summary
`java.lang.String` `createFragment(IndexReader reader, int docId, java.lang.String fieldName, FieldFragList fieldFragList)` create a fragment.
`java.lang.String[]` `createFragments(IndexReader reader, int docId, java.lang.String fieldName, FieldFragList fieldFragList, int maxNumFragments)` create multiple fragments.
`protected Field[]` `getFields(IndexReader reader, int docId, java.lang.String fieldName)`
`protected java.lang.String[]` `getFieldValues(IndexReader reader, int docId, java.lang.String fieldName)` Deprecated.
`protected java.lang.String` `getFragmentSource(java.lang.StringBuilder buffer, int[] index, Field[] values, int startOffset, int endOffset)`
`protected java.lang.String` `getFragmentSource(java.lang.StringBuilder buffer, int[] index, java.lang.String[] values, int startOffset, int endOffset)` Deprecated.
`protected java.lang.String` `getPostTag(int num)`
`protected java.lang.String` `getPreTag(int num)`
`abstract java.util.List<FieldFragList.WeightedFragInfo>` `getWeightedFragInfoList(java.util.List<FieldFragList.WeightedFragInfo> src)`
`protected java.lang.String` `makeFragment(java.lang.StringBuilder buffer, int[] index, Field[] values, FieldFragList.WeightedFragInfo fragInfo)`
`protected java.lang.String` `makeFragment(java.lang.StringBuilder buffer, int[] index, java.lang.String[] values, FieldFragList.WeightedFragInfo fragInfo)` Deprecated.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### preTags

    protected java.lang.String[] preTags

### postTags

    protected java.lang.String[] postTags

### COLORED_PRE_TAGS

    public static final java.lang.String[] COLORED_PRE_TAGS

### COLORED_POST_TAGS

    public static final java.lang.String[] COLORED_POST_TAGS

Constructor Detail

### BaseFragmentsBuilder

    protected BaseFragmentsBuilder()

### BaseFragmentsBuilder

    protected BaseFragmentsBuilder(java.lang.String[] preTags,
                                   java.lang.String[] postTags)

Method Detail

### getWeightedFragInfoList

    public abstract java.util.List<FieldFragList.WeightedFragInfo> getWeightedFragInfoList(java.util.List<FieldFragList.WeightedFragInfo> src)

### createFragment

    public java.lang.String createFragment(IndexReader reader,
                                           int docId,
                                           java.lang.String fieldName,
                                           FieldFragList fieldFragList)
                                    throws java.io.IOException

  Description copied from interface: `FragmentsBuilder`
  create a fragment.

  Specified by:
    `createFragment` in interface `FragmentsBuilder`
  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

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

  Description copied from interface: `FragmentsBuilder`
  create multiple fragments.

  Specified by:
    `createFragments` in interface `FragmentsBuilder`
  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`

### getFieldValues

    @Deprecated
    protected java.lang.String[] getFieldValues(IndexReader reader,
                                                           int docId,
                                                           java.lang.String fieldName)
                                         throws java.io.IOException

  Deprecated.

  Throws:
    `java.io.IOException`

### getFields

    protected Field[] getFields(IndexReader reader,
                                int docId,
                                java.lang.String fieldName)
                         throws java.io.IOException

  Throws:
    `java.io.IOException`

### makeFragment

    @Deprecated
    protected java.lang.String makeFragment(java.lang.StringBuilder buffer,
                                                       int[] index,
                                                       java.lang.String[] values,
                                                       FieldFragList.WeightedFragInfo fragInfo)

  Deprecated.

### makeFragment

    protected java.lang.String makeFragment(java.lang.StringBuilder buffer,
                                            int[] index,
                                            Field[] values,
                                            FieldFragList.WeightedFragInfo fragInfo)

### getFragmentSource

    @Deprecated
    protected java.lang.String getFragmentSource(java.lang.StringBuilder buffer,
                                                            int[] index,
                                                            java.lang.String[] values,
                                                            int startOffset,
                                                            int endOffset)

  Deprecated.

### getFragmentSource

    protected java.lang.String getFragmentSource(java.lang.StringBuilder buffer,
                                                 int[] index,
                                                 Field[] values,
                                                 int startOffset,
                                                 int endOffset)

### getPreTag

    protected java.lang.String getPreTag(int num)

### getPostTag

    protected java.lang.String getPostTag(int num)

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