Google Cloud Discovery Engine V1beta Client - Class SnippetSpec (0.5.0)

Reference documentation and code samples for the Google Cloud Discovery Engine V1beta Client class SnippetSpec.

The specification that configs the snippet in the search results.

Generated from protobuf message google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec

Namespace

Google \ Cloud \ DiscoveryEngine \ V1beta \ SearchRequest \ ContentSearchSpec

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ max_snippet_count int

Max number of snippets returned in each search result. A snippet is an infomartive summary of a content with highlighting for UI rendering. If the matching snippets is less than the max_snippet_count, return all of the snippets; otherwise, return the max_snippet_count. At most 5 snippets will be returned for each SearchResult.

↳ reference_only bool

if true, only snippet reference is returned.

getMaxSnippetCount

Max number of snippets returned in each search result.

A snippet is an infomartive summary of a content with highlighting for UI rendering. If the matching snippets is less than the max_snippet_count, return all of the snippets; otherwise, return the max_snippet_count. At most 5 snippets will be returned for each SearchResult.

Returns
TypeDescription
int

setMaxSnippetCount

Max number of snippets returned in each search result.

A snippet is an infomartive summary of a content with highlighting for UI rendering. If the matching snippets is less than the max_snippet_count, return all of the snippets; otherwise, return the max_snippet_count. At most 5 snippets will be returned for each SearchResult.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getReferenceOnly

if true, only snippet reference is returned.

Returns
TypeDescription
bool

setReferenceOnly

if true, only snippet reference is returned.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this