All Products
Search
Document Center

OpenSearch:Summary

Last Updated:Oct 10, 2023

Overview

This topic describes the Summary class and its methods. The Summary class is used to configure summaries and highlights for search results.

Constructor (1)

This constructor requires you to specify a field based on which a summary is to be generated.
Summary(String summary_field)

Parameter description

Parameter

Type

Description

summary_field

String

The field based on which a summary is to be generated.

Constructor (2)

This constructor requires you to specify another Summary object as a parameter.
Summary(Summary other)

Parameter description

Parameter

Type

Description

other

Summary

The Summary object.

Constructor (3)

This constructor requires no parameter.
Summary()

setSummary_field

Method definition

Specifies a field based on which a summary is to be generated.
Summary        setSummary_field(String summary_field)

Parameter description

Parameter

Type

Description

summary_field

String

The field based on which a summary is to be generated.


getSummary_field

Method definition

Obtains the specified field based on which a summary is to be generated.
String    getSummary_field()

Return value

  • The specified field based on which a summary is to be generated. Type: String.


setSummary_len

Method definition

Specifies the length of each summary snippet.
Summary    setSummary_len(int summary_len)

Parameter description

Parameter

Type

Description

summary_len

int

The length of each summary snippet, in bytes. The length of a digit or letter is one byte.


getSummary_len

Method definition

Obtains the specified length of each summary snippet.
String    getSummary_len()

Return value

  • The specified length of each summary snippet. Type: String.


setSummary_element

Method definition

Specifies an element to be used to highlight the query that hits one or more summary snippets.
Summary    setSummary_element(String summary_element)

Parameter description

Parameter

Type

Description

summary_element

String

The element to be used to highlight the query that hits one or more summary snippets. The value can be em or a custom element.


getSummary_element

Method definition

Obtains the specified element to be used to highlight the query that hits one or more summary snippets.
String    getSummary_element()

Return value

  • The specified element to be used to highlight the query that hits one or more summary snippets. Type: String.


setSummary_ellipsis

Method definition

Specifies a string to be used to represent the data that is not displayed.
Summary    setSummary_ellipsis(String summary_ellipsis)

Parameter description

Parameter

Type

Description

summary_ellipsis

String

The string to be used to represent the data that is not displayed. Example: "..."


getSummary_ellipsis

Method definition

Obtains the specified string to be used to represent the data that is not displayed.
String    getSummary_ellipsis()

Return value

  • The specified string to be used to represent the data that is not displayed. Type: String.


setSummary_snippet

Method definition

Specifies the number of summary snippets that each query can hit.
Summary    setSummary_snippet(int summary_snippet)

Parameter description

Parameter

Type

Description

summary_snippet

int

The number of summary snippets that each query can hit.


getSummary_snippet

Method definition

Obtains the specified number of summary snippets that each query can hit.
String    getSummary_snippet()

Return value

  • The specified number of summary snippets that each query can hit. Type: String.