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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencoder(HighlighterEncoder encoder) Specify the encoder for the highlighted output.fragmentSize(int size) Specify the size of the highlighted fragments in characters.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.numberOfFragments(int number) Specify the maximum number of highlighted snippets to be returned.orderByScore(boolean enable) Specify if the highlighted fragments should be ordered by score.Specify the tags to wrap the highlighted text.Create an instance of aSearchHighlightermatching the configuration applied in the previous steps of this DSL.
-
Field Details
-
highlighterBuilder
-
-
Constructor Details
-
HighlighterOptionsStepImpl
-
-
Method Details
-
encoder
Description copied from interface:HighlighterOptionsStepSpecify the encoder for the highlighted output.- Specified by:
encoderin interfaceHighlighterOptionsStep<T extends HighlighterOptionsStep<T>>- Parameters:
encoder- The encoder to be applied.- Returns:
- The next step in a highlighter definition.
- See Also:
-
fragmentSize
Description copied from interface:HighlighterOptionsStepSpecify the size of the highlighted fragments in characters.- Specified by:
fragmentSizein interfaceHighlighterOptionsStep<T extends HighlighterOptionsStep<T>>- Parameters:
size- The number of characters in highlighted fragments.- Returns:
- The next step in a highlighter definition.
-
noMatchSize
Description copied from interface:HighlighterOptionsStepSpecify the amount of text to be returned, starting at the beginning of the field if there are no matching fragments to highlight.- Specified by:
noMatchSizein interfaceHighlighterOptionsStep<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
Description copied from interface:HighlighterOptionsStepSpecify the maximum number of highlighted snippets to be returned.- Specified by:
numberOfFragmentsin interfaceHighlighterOptionsStep<T extends HighlighterOptionsStep<T>>- Parameters:
number- The number of snippets to return.- Returns:
- The next step in a highlighter definition.
-
orderByScore
Description copied from interface:HighlighterOptionsStepSpecify 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:
orderByScorein interfaceHighlighterOptionsStep<T extends HighlighterOptionsStep<T>>- Parameters:
enable- The parameter to enable/disable score ordering.- Returns:
- The next step in a highlighter definition.
-
tag
Description copied from interface:HighlighterOptionsStepSpecify 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:
tagin interfaceHighlighterOptionsStep<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
Description copied from interface:HighlighterFinalStepCreate an instance of aSearchHighlightermatching the configuration applied in the previous steps of this DSL.- Specified by:
toHighlighterin interfaceHighlighterFinalStep- Returns:
- The
SearchHighlighterresulting from the previous DSL steps.
-