The Summary object defines the search result summary configured for a version of an OpenSearch application. It controls how matched terms are highlighted and how text segments are extracted and joined in search results.
Example
{
"name": "default",
"meta": [{
"field": "title",
"len": 50,
"element": "em",
"ellipsis": "...",
"snippet": 1
}],
"active": true
}Structure
| Field | Type | Description |
|---|---|---|
name | String | The name of the search result summary. The only valid value is default. |
meta[] | Object | The summary settings. Each object in the array configures how a specific field is summarized. See meta. |
active | Boolean | Indicates whether the search result summary is the default one. |
meta
| Field | Type | Description |
|---|---|---|
field | String | The document field to generate a summary for. |
len | Integer | The maximum length of the summary text. Valid values: 1–300. |
element | String | The HTML tag used to highlight terms in red in the summary. For example, em. |
ellipsis | String | The string used to connect adjacent text segments in the summary. For example, .... |
snippet | Integer | The number of text segments included in the summary. Valid values: 1–5. |
该文章对您有帮助吗?