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
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringA string that contains each boundary character.final IntegerHow far to scan for boundary characters.final BoundaryScannerSpecifies how to break the highlighted fragments: chars, sentence, or word.final StringControls which locale is used to search for sentence and word boundaries.final BooleanDeprecated.8.8.0final HighlighterFragmenterSpecifies how text should be broken up in highlight snippets:simpleorspan.final IntegerThe size of the highlighted fragment in characters.final BooleanAPI name:highlight_filterfinal QueryHighlight matches for a query other than the search query.final IntegerIf set to a non-negative value, highlighting stops at this defined maximum limit.final IntegerAPI name:max_fragment_lengthfinal IntegerThe amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.final IntegerThe maximum number of fragments to return.options()API name:optionsfinal HighlighterOrderorder()Sorts highlighted fragments by score when set toscore.final IntegerControls the number of matching phrases in a document that are considered.postTags()Use in conjunction withpre_tagsto define the HTML tags to use for the highlighted text.preTags()Use in conjunction withpost_tagsto define the HTML tags to use for the highlighted text.final BooleanBy default, only fields that contains a query match are highlighted.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static <BuilderT extends HighlightBase.AbstractBuilder<BuilderT>>
voidsetupHighlightBaseDeserializer(ObjectDeserializer<BuilderT> op) final HighlighterTagsSchemaSet tostyledto use the built-in tag schema.toString()final Stringtype()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 tosentencefor theunifiedhighlighter. Defaults tocharsfor thefvhhighlighter.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:simpleorspan. Only valid for theplainhighlighter.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_offsetquery setting does not override theindex.highlight.max_analyzed_offsetsetting, 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_fragmentsis0,fragment_sizeis 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 toscorewill 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 thefvhhighlighter from analyzing too many phrases and consuming too much memory. When usingmatched_fields,phrase_limitphrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by thefvhhighlighter.API name:
phrase_limit -
postTags
Use in conjunction withpre_tagsto 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_tagsto 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 tofalseto highlight all fields.API name:
require_field_match -
tagsSchema
Set tostyledto use the built-in tag schema.API name:
tags_schema -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupHighlightBaseDeserializer
protected static <BuilderT extends HighlightBase.AbstractBuilder<BuilderT>> void setupHighlightBaseDeserializer(ObjectDeserializer<BuilderT> op)
-