Class HighlighterOptionsStepImpl<T extends HighlighterOptionsStep<T>>

java.lang.Object
org.hibernate.search.engine.search.highlighter.dsl.impl.HighlighterOptionsStepImpl<T>
All Implemented Interfaces:
HighlighterFinalStep, HighlighterOptionsStep<T>
Direct Known Subclasses:
HighlighterFastVectorHighlighterOptionsStepImpl, HighlighterPlainOptionsStepImpl, HighlighterUnifiedOptionsStepImpl

public class HighlighterOptionsStepImpl<T extends HighlighterOptionsStep<T>> extends Object implements HighlighterOptionsStep<T>, HighlighterFinalStep
  • Field Details

  • Constructor Details

  • Method Details

    • encoder

      public T encoder(HighlighterEncoder encoder)
      Description copied from interface: HighlighterOptionsStep
      Specify the encoder for the highlighted output.
      Specified by:
      encoder in interface HighlighterOptionsStep<T extends HighlighterOptionsStep<T>>
      Parameters:
      encoder - The encoder to be applied.
      Returns:
      The next step in a highlighter definition.
      See Also:
    • fragmentSize

      public T fragmentSize(int size)
      Description copied from interface: HighlighterOptionsStep
      Specify the size of the highlighted fragments in characters.
      Specified by:
      fragmentSize in interface HighlighterOptionsStep<T extends HighlighterOptionsStep<T>>
      Parameters:
      size - The number of characters in highlighted fragments.
      Returns:
      The next step in a highlighter definition.
    • 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.
    • numberOfFragments

      public T numberOfFragments(int number)
      Description copied from interface: HighlighterOptionsStep
      Specify the maximum number of highlighted snippets to be returned.
      Specified by:
      numberOfFragments in interface HighlighterOptionsStep<T extends HighlighterOptionsStep<T>>
      Parameters:
      number - The number of snippets to return.
      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.
    • toHighlighter

      public SearchHighlighter toHighlighter()
      Description copied from interface: HighlighterFinalStep
      Create an instance of a SearchHighlighter matching the configuration applied in the previous steps of this DSL.
      Specified by:
      toHighlighter in interface HighlighterFinalStep
      Returns:
      The SearchHighlighter resulting from the previous DSL steps.