Class BaseFragmentsBuilder

    • Field Detail

      • COLORED_PRE_TAGS

        public static final java.lang.String[] COLORED_PRE_TAGS
      • COLORED_POST_TAGS

        public static final java.lang.String[] COLORED_POST_TAGS
    • Method Detail

      • 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 - If there is a low-level I/O error
      • 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 - If there is a low-level I/O error
      • createFragment

        public java.lang.String createFragment​(IndexReader reader,
                                               int docId,
                                               java.lang.String fieldName,
                                               FieldFragList fieldFragList,
                                               java.lang.String[] preTags,
                                               java.lang.String[] postTags,
                                               Encoder encoder)
                                        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
        preTags - pre-tags to be used to highlight terms
        postTags - post-tags to be used to highlight terms
        encoder - an encoder that generates encoded text
        Returns:
        a created fragment or null when no fragment created
        Throws:
        java.io.IOException - If there is a low-level I/O error
      • createFragments

        public java.lang.String[] createFragments​(IndexReader reader,
                                                  int docId,
                                                  java.lang.String fieldName,
                                                  FieldFragList fieldFragList,
                                                  int maxNumFragments,
                                                  java.lang.String[] preTags,
                                                  java.lang.String[] postTags,
                                                  Encoder encoder)
                                           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
        preTags - pre-tags to be used to highlight terms
        postTags - post-tags to be used to highlight terms
        encoder - an encoder that generates encoded text
        Returns:
        created fragments or null when no fragments created. size of the array can be less than maxNumFragments
        Throws:
        java.io.IOException - If there is a low-level I/O error
      • setMultiValuedSeparator

        public void setMultiValuedSeparator​(char separator)
      • getMultiValuedSeparator

        public char getMultiValuedSeparator()
      • isDiscreteMultiValueHighlighting

        public boolean isDiscreteMultiValueHighlighting()
      • setDiscreteMultiValueHighlighting

        public void setDiscreteMultiValueHighlighting​(boolean discreteMultiValueHighlighting)