Highlight

October 23, 2025 ยท View on GitHub

Properties

NameTypeDescriptionNotes
fragment_sizeintMaximum size of the text fragments in highlighted snippets per field[optional]
limitintMaximum size of snippets per field[optional]
limit_snippetsintMaximum number of snippets per field[optional]
limit_wordsintMaximum number of words per field[optional]
number_of_fragmentsintTotal number of highlighted fragments per field[optional]
after_matchstrText inserted after the matched term, typically used for HTML formatting[optional] [default to '']
allow_emptyboolPermits an empty string to be returned as the highlighting result. Otherwise, the beginning of the original text would be returned[optional]
aroundintNumber of words around the match to include in the highlight[optional]
before_matchstrText inserted before the match, typically used for HTML formatting[optional] [default to '']
emit_zonesboolEmits an HTML tag with the enclosing zone name before each highlighted snippet[optional]
encoderstrIf set to 'html', retains HTML markup when highlighting[optional]
fieldsHighlightFields[optional]
force_all_wordsboolIgnores the length limit until the result includes all keywords[optional]
force_snippetsboolForces snippet generation even if limits allow highlighting the entire text[optional]
highlight_queryQueryFilter[optional]
html_strip_modestrDefines the mode for handling HTML markup in the highlight[optional]
limits_per_fieldboolDetermines whether the 'limit', 'limit_words', and 'limit_snippets' options operate as individual limits in each field of the document[optional]
no_match_sizeintIf set to 1, allows an empty string to be returned as a highlighting result[optional]
orderstrSets the sorting order of highlighted snippets[optional]
pre_tagsstrText inserted before each highlighted snippet[optional] [default to '']
post_tagsstrText inserted after each highlighted snippet[optional] [default to '']
start_snippet_idintSets the starting value of the %SNIPPET_ID% macro[optional]
use_boundariesboolDefines whether to additionally break snippets by phrase boundary characters[optional]

Example

from manticoresearch.models.highlight import Highlight

# TODO update the JSON string below
json = "{}"
# create an instance of Highlight from a JSON string
highlight_instance = Highlight.from_json(json)
# print the JSON string representation of the object
print(Highlight.to_json())

# convert the object into a dict
highlight_dict = highlight_instance.to_dict()
# create an instance of Highlight from a dict
highlight_from_dict = Highlight.from_dict(highlight_dict)

[Back to Model list] [Back to API list] [Back to README]