HighlightParameter
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 query summary and highlight features are 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: |
|
post_tag |
string |
No |
The closing tag that you want to use to highlight the query string. Examples: |
|
fragments_order |
No |
The sorting rule for the highlighted text fragments that you want to return. |