Class HighlightBase
java.lang.Object
co.elastic.clients.elasticsearch.core.search.HighlightBase
- All Implemented Interfaces:
JsonpSerializable
- Direct Known Subclasses:
Highlight
,HighlightField
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
A string that contains each boundary character.final Integer
How far to scan for boundary characters.final BoundaryScanner
Specifies how to break the highlighted fragments: chars, sentence, or word.final String
Controls which locale is used to search for sentence and word boundaries.final Boolean
Deprecated.8.8.0final HighlighterFragmenter
Specifies how text should be broken up in highlight snippets:simple
orspan
.final Integer
The size of the highlighted fragment in characters.final Boolean
API name:highlight_filter
final Query
Highlight matches for a query other than the search query.final Integer
If set to a non-negative value, highlighting stops at this defined maximum limit.final Integer
API name:max_fragment_length
final Integer
The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.final Integer
The maximum number of fragments to return.options()
API name:options
final HighlighterOrder
order()
Sorts highlighted fragments by score when set toscore
.final Integer
Controls the number of matching phrases in a document that are considered.postTags()
Use in conjunction withpre_tags
to define the HTML tags to use for the highlighted text.preTags()
Use in conjunction withpost_tags
to define the HTML tags to use for the highlighted text.final Boolean
By default, only fields that contains a query match are highlighted.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static <BuilderT extends HighlightBase.AbstractBuilder<BuilderT>>
voidsetupHighlightBaseDeserializer
(ObjectDeserializer<BuilderT> op) final HighlighterTagsSchema
Set tostyled
to use the built-in tag schema.toString()
final String
type()
API name:type
-
Constructor Details
-
HighlightBase
-
-
Method Details
-
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
-
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
-
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
-
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
-
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
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupHighlightBaseDeserializer
protected static <BuilderT extends HighlightBase.AbstractBuilder<BuilderT>> void setupHighlightBaseDeserializer(ObjectDeserializer<BuilderT> op)
-