Google Cloud Discovery Engine V1 Client - Class SnippetSpec (0.3.0)

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

The specification that configs the snippet in the search results.

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

Namespace

Google \ Cloud \ DiscoveryEngine \ V1 \ 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. 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.

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.

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