Interface HighlighterOptionsStep<T extends HighlighterOptionsStep<?>>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T encoder​(HighlighterEncoder encoder)
      Specify the encoder for the highlighted output.
      T fragmentSize​(int size)
      Specify the size of the highlighted fragments in characters.
      T noMatchSize​(int size)
      Specify the amount of text to be returned, starting at the beginning of the field if there are no matching fragments to highlight.
      T numberOfFragments​(int number)
      Specify the maximum number of highlighted snippets to be returned.
      T orderByScore​(boolean enable)
      Specify if the highlighted fragments should be ordered by score.
      T tag​(String preTag, String postTag)
      Specify the tags to wrap the highlighted text.
    • Method Detail

      • fragmentSize

        T fragmentSize​(int size)
        Specify the size of the highlighted fragments in characters.
        Parameters:
        size - The number of characters in highlighted fragments.
        Returns:
        The next step in a highlighter definition.
      • noMatchSize

        T noMatchSize​(int size)
        Specify the amount of text to be returned, starting at the beginning of the field if there are no matching fragments to highlight.
        Parameters:
        size - The number of characters to include in the returned snippet.
        Returns:
        The next step in a highlighter definition.
      • numberOfFragments

        T numberOfFragments​(int number)
        Specify the maximum number of highlighted snippets to be returned.
        Parameters:
        number - The number of snippets to return.
        Returns:
        The next step in a highlighter definition.
      • orderByScore

        T orderByScore​(boolean enable)
        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.
        Parameters:
        enable - The parameter to enable/disable score ordering.
        Returns:
        The next step in a highlighter definition.
      • tag

        T tag​(String preTag,
              String postTag)
        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.

        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.
      • encoder

        T encoder​(HighlighterEncoder encoder)
        Specify the encoder for the highlighted output.
        Parameters:
        encoder - The encoder to be applied.
        Returns:
        The next step in a highlighter definition.
        See Also:
        HighlighterEncoder