Interface HighlighterOptionsStep<T extends HighlighterOptionsStep<?>>
- All Superinterfaces:
HighlighterFinalStep
- All Known Subinterfaces:
HighlighterFastVectorHighlighterOptionsStep
,HighlighterPlainOptionsStep
,HighlighterUnifiedOptionsStep
public interface HighlighterOptionsStep<T extends HighlighterOptionsStep<?>>
extends HighlighterFinalStep
The step in a highlighter definition where options can be set. Refer to your particular backend documentation
for more detailed information on the exposed settings.
-
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.Methods inherited from interface org.hibernate.search.engine.search.highlighter.dsl.HighlighterFinalStep
toHighlighter
-
Method Details
-
fragmentSize
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
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
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
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
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
Specify the encoder for the highlighted output.- Parameters:
encoder
- The encoder to be applied.- Returns:
- The next step in a highlighter definition.
- See Also:
-