Summary

更新时间:
复制 MD 格式

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

FieldTypeDescription
nameStringThe name of the search result summary. The only valid value is default.
meta[]ObjectThe summary settings. Each object in the array configures how a specific field is summarized. See meta.
activeBooleanIndicates whether the search result summary is the default one.

meta

FieldTypeDescription
fieldStringThe document field to generate a summary for.
lenIntegerThe maximum length of the summary text. Valid values: 1–300.
elementStringThe HTML tag used to highlight terms in red in the summary. For example, em.
ellipsisStringThe string used to connect adjacent text segments in the summary. For example, ....
snippetIntegerThe number of text segments included in the summary. Valid values: 1–5.