Class HighlighterOptionsStepImpl<T extends HighlighterOptionsStep<T>>

    • Constructor Detail

    • Method Detail

      • noMatchSize

        public T noMatchSize​(int size)
        Description copied from interface: HighlighterOptionsStep
        Specify the amount of text to be returned, starting at the beginning of the field if there are no matching fragments to highlight.
        Specified by:
        noMatchSize in interface HighlighterOptionsStep<T extends HighlighterOptionsStep<T>>
        Parameters:
        size - The number of characters to include in the returned snippet.
        Returns:
        The next step in a highlighter definition.
      • orderByScore

        public T orderByScore​(boolean enable)
        Description copied from interface: HighlighterOptionsStep
        Specify if the highlighted fragments should be ordered by score. By default, the fragments are returned in the order they are present in the field.
        Specified by:
        orderByScore in interface HighlighterOptionsStep<T extends HighlighterOptionsStep<T>>
        Parameters:
        enable - The parameter to enable/disable score ordering.
        Returns:
        The next step in a highlighter definition.
      • tag

        public T tag​(String preTag,
                     String postTag)
        Description copied from interface: HighlighterOptionsStep
        Specify the tags to wrap the highlighted text. Can be a pair of an HTML tags as well as any sequence of characters.

        In case this method is called multiple times on a single highlighter definition, then the last pair of supplied tags will be applied, as highlighters require only one pair of tags.

        By default, highlighted text is wrapped using <em> and </em> tags.

        Specified by:
        tag in interface HighlighterOptionsStep<T extends HighlighterOptionsStep<T>>
        Parameters:
        preTag - The opening (pre) tag placed before the highlighted text.
        postTag - The closing (post) tag placed after the highlighted text.
        Returns:
        The next step in a highlighter definition.