The Open API specification for Synapse is now available for download!

Download Open API Spec

Highlight

org.sagebionetworks.repo.model.search.dsl.Highlight

A highlight block. Adds matched-term snippet fragments to each hit. Top-level options apply to every highlighted field unless overridden in a per-field block under fields.

Field Type Description
fragment_size INTEGER Optional. Maximum characters per highlighted fragment. Capped server-side.
fragment_offset INTEGER Optional. Character offset at which to start highlighting (fvh only).
no_match_size INTEGER Optional. Number of leading characters to return when there is no match.
order STRING Optional. Fragment ordering: none (default) or score.
fragmenter STRING Optional. Fragmentation strategy: simple or span (plain highlighter).
boundary_scanner STRING Optional. Boundary detection: chars, sentence, or word.
boundary_scanner_locale STRING Optional. Locale used by the boundary scanner.
boundary_chars STRING Optional. Characters treated as boundaries by the chars scanner.
boundary_max_scan INTEGER Optional. How far the boundary scanner looks for a boundary.
max_fragment_length INTEGER Optional. Maximum length of a fragment.
max_analyzer_offset INTEGER Optional. Maximum character offset analyzed for highlighting.
phrase_limit INTEGER Optional. Maximum number of matching phrases considered (fvh only).
require_field_match BOOLEAN Optional. Whether only fields that matched the query are highlighted. Default true.
highlight_filter BOOLEAN Optional. Whether to highlight only fields that passed the query filter.
force_source BOOLEAN Optional. Whether to highlight from the original _source rather than stored fields.
tags_schema STRING Optional. Built-in tag schema (styled) for the highlight markup.
fields MAP<STRING,HighlightField> Required. The columns to highlight, keyed by column name; each value is its per-field option overrides.
type STRING Optional. Default highlighter implementation: unified (default), plain, or fvh. The semantic highlighter is rejected.
number_of_fragments INTEGER Optional. Maximum number of fragments per field. Capped server-side.
encoder STRING Optional. How highlighted text is encoded: default or html.
pre_tags ARRAY<STRING> Optional. Opening tags wrapped around highlighted terms. Default <em>.
post_tags ARRAY<STRING> Optional. Closing tags wrapped around highlighted terms. Default </em>.
highlight_query Query

A single OpenSearch query DSL clause. Exactly one of the properties below may be set — the set property names the clause kind. See query vs. filter context and term-level vs. full-text queries.

The field-keyed leaf clauses (match, term, range, ...) are maps whose key is the column name and whose value is the per-field options object — only the long form is accepted (e.g. {"match":{"title":{"query":"x"}}}, not the {"match":{"title":"x"}} shorthand). The compound clauses (bool, dis_max, ...) nest further Query DSL clauses recursively.