Class HighlightBase.AbstractBuilder<BuilderT extends HighlightBase.AbstractBuilder<BuilderT>>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch.core.search.HighlightBase.AbstractBuilder<BuilderT>
- All Implemented Interfaces:
WithJson<BuilderT>
- Direct Known Subclasses:
Highlight.Builder
,HighlightField.Builder
- Enclosing class:
- HighlightBase
public abstract static class HighlightBase.AbstractBuilder<BuilderT extends HighlightBase.AbstractBuilder<BuilderT>>
extends WithJsonObjectBuilderBase<BuilderT>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal BuilderT
boundaryChars
(String value) A string that contains each boundary character.final BuilderT
boundaryMaxScan
(Integer value) How far to scan for boundary characters.final BuilderT
boundaryScanner
(BoundaryScanner value) Specifies how to break the highlighted fragments: chars, sentence, or word.final BuilderT
boundaryScannerLocale
(String value) Controls which locale is used to search for sentence and word boundaries.final BuilderT
forceSource
(Boolean value) Deprecated.8.8.0final BuilderT
fragmenter
(HighlighterFragmenter value) Specifies how text should be broken up in highlight snippets:simple
orspan
.final BuilderT
fragmentSize
(Integer value) The size of the highlighted fragment in characters.final BuilderT
highlightFilter
(Boolean value) API name:highlight_filter
final BuilderT
highlightQuery
(Query value) Highlight matches for a query other than the search query.final BuilderT
Highlight matches for a query other than the search query.final BuilderT
maxAnalyzedOffset
(Integer value) If set to a non-negative value, highlighting stops at this defined maximum limit.final BuilderT
maxFragmentLength
(Integer value) API name:max_fragment_length
final BuilderT
noMatchSize
(Integer value) The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.final BuilderT
numberOfFragments
(Integer value) The maximum number of fragments to return.final BuilderT
API name:options
final BuilderT
API name:options
final BuilderT
order
(HighlighterOrder value) Sorts highlighted fragments by score when set toscore
.final BuilderT
phraseLimit
(Integer value) Controls the number of matching phrases in a document that are considered.final BuilderT
Use in conjunction withpre_tags
to define the HTML tags to use for the highlighted text.final BuilderT
Use in conjunction withpre_tags
to define the HTML tags to use for the highlighted text.final BuilderT
Use in conjunction withpost_tags
to define the HTML tags to use for the highlighted text.final BuilderT
Use in conjunction withpost_tags
to define the HTML tags to use for the highlighted text.final BuilderT
requireFieldMatch
(Boolean value) By default, only fields that contains a query match are highlighted.protected abstract BuilderT
self()
final BuilderT
tagsSchema
(HighlighterTagsSchema value) Set tostyled
to use the built-in tag schema.final BuilderT
type
(HighlighterType value) API name:type
final BuilderT
API name:type
Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
AbstractBuilder
public AbstractBuilder()
-
-
Method Details
-
type
API name:type
-
type
API name:type
-
boundaryChars
A string that contains each boundary character.API name:
boundary_chars
-
boundaryMaxScan
How far to scan for boundary characters.API name:
boundary_max_scan
-
boundaryScanner
Specifies how to break the highlighted fragments: chars, sentence, or word. Only valid for the unified and fvh highlighters. Defaults tosentence
for theunified
highlighter. Defaults tochars
for thefvh
highlighter.API name:
boundary_scanner
-
boundaryScannerLocale
Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example:"en-US"
,"fr-FR"
,"ja-JP"
.API name:
boundary_scanner_locale
-
forceSource
Deprecated.8.8.0API name:force_source
-
fragmenter
Specifies how text should be broken up in highlight snippets:simple
orspan
. Only valid for theplain
highlighter.API name:
fragmenter
-
fragmentSize
The size of the highlighted fragment in characters.API name:
fragment_size
-
highlightFilter
API name:highlight_filter
-
highlightQuery
Highlight matches for a query other than the search query. This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.API name:
highlight_query
-
highlightQuery
Highlight matches for a query other than the search query. This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.API name:
highlight_query
-
maxFragmentLength
API name:max_fragment_length
-
maxAnalyzedOffset
If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned Themax_analyzed_offset
query setting does not override theindex.highlight.max_analyzed_offset
setting, which prevails when it’s set to lower value than the query setting.API name:
max_analyzed_offset
-
noMatchSize
The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.API name:
no_match_size
-
numberOfFragments
The maximum number of fragments to return. If the number of fragments is set to0
, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. Ifnumber_of_fragments
is0
,fragment_size
is ignored.API name:
number_of_fragments
-
options
API name:options
Adds all entries of
map
tooptions
. -
options
API name:options
Adds an entry to
options
. -
order
Sorts highlighted fragments by score when set toscore
. By default, fragments will be output in the order they appear in the field (order:none
). Setting this option toscore
will output the most relevant fragments first. Each highlighter applies its own logic to compute relevancy scores.API name:
order
-
phraseLimit
Controls the number of matching phrases in a document that are considered. Prevents thefvh
highlighter from analyzing too many phrases and consuming too much memory. When usingmatched_fields
,phrase_limit
phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by thefvh
highlighter.API name:
phrase_limit
-
postTags
Use in conjunction withpre_tags
to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in<em>
and</em>
tags.API name:
post_tags
Adds all elements of
list
topostTags
. -
postTags
Use in conjunction withpre_tags
to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in<em>
and</em>
tags.API name:
post_tags
Adds one or more values to
postTags
. -
preTags
Use in conjunction withpost_tags
to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in<em>
and</em>
tags.API name:
pre_tags
Adds all elements of
list
topreTags
. -
preTags
Use in conjunction withpost_tags
to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in<em>
and</em>
tags.API name:
pre_tags
Adds one or more values to
preTags
. -
requireFieldMatch
By default, only fields that contains a query match are highlighted. Set tofalse
to highlight all fields.API name:
require_field_match
-
tagsSchema
Set tostyled
to use the built-in tag schema.API name:
tags_schema
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<BuilderT extends HighlightBase.AbstractBuilder<BuilderT>>
-