All Products
Search
Document Center

Tablestore:HighlightParameter

Last Updated:Feb 06, 2025

HighlightParameter specifies the highlight parameters.

Data structure

message HighlightParameter {
    optional string  field_name = 1;
    optional int32   number_of_fragments = 2;
    optional int32   fragment_size = 3;
    optional string  pre_tag = 4;
    optional string  post_tag = 5;
    optional HighlightFragmentOrder fragments_order = 6 [default=TEXT_SEQUENCE];
}

Parameter

Type

Required

Description

field_name

string

Yes

The name of the field. Make sure that the highlight feature is enabled for the field when you create the search index.

number_of_fragments

int32

No

The maximum number of highlighted text fragments that you want to return. We recommend that you set this parameter to 1.

fragment_size

int32

No

The length of each text fragment that you want to return. Default value: 100.

pre_tag

string

No

The opening tag that you want to use to highlight the query string. Examples: <em> and <b>. Default value: <em>. You can specify a custom opening tag based on your business requirements. The pre_tag parameter supports the following character sets: < > " ' /, a-z, A-Z, and 0-9.

post_tag

string

No

The closing tag that you want to use to highlight the query string. Examples: </em> and </b>. Default value: </em>. You can specify a custom closing tag based on your business requirements. The post_tag parameter supports the following character sets: < > " ' /, a-z, A-Z, and 0-9.

fragments_order

HighlightFragmentOrder

No

The sorting rule for the highlighted text fragments that you want to return.