[DEPRECATED] This field is deprecated. To control snippet return, use return_snippet field. For backwards compatibility, we will return snippet if max_snippet_count > 0.
โณ reference_only
bool
[DEPRECATED] This field is deprecated and will have no affect on the snippet.
โณ return_snippet
bool
If true, then return snippet. If no snippet can be generated, we return "No snippet is available for this page." A snippet_status with SUCCESS or NO_SNIPPET_AVAILABLE will also be returned.
getMaxSnippetCount
[DEPRECATED] This field is deprecated. To control snippet return, use
return_snippet field. For backwards compatibility, we will return
snippet if max_snippet_count > 0.
Returns
Type
Description
int
setMaxSnippetCount
[DEPRECATED] This field is deprecated. To control snippet return, use
return_snippet field. For backwards compatibility, we will return
snippet if max_snippet_count > 0.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getReferenceOnly
[DEPRECATED] This field is deprecated and will have no affect on the
snippet.
Returns
Type
Description
bool
setReferenceOnly
[DEPRECATED] This field is deprecated and will have no affect on the
snippet.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getReturnSnippet
If true, then return snippet. If no snippet can be generated, we
return "No snippet is available for this page." A snippet_status with
SUCCESS or NO_SNIPPET_AVAILABLE will also be returned.
Returns
Type
Description
bool
setReturnSnippet
If true, then return snippet. If no snippet can be generated, we
return "No snippet is available for this page." A snippet_status with
SUCCESS or NO_SNIPPET_AVAILABLE will also be returned.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Discovery Engine V1 Client - Class SnippetSpec (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/php/docs/reference/cloud-discoveryengine/latest/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [1.6.1](/php/docs/reference/cloud-discoveryengine/1.6.1/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [1.5.1](/php/docs/reference/cloud-discoveryengine/1.5.1/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [1.4.0](/php/docs/reference/cloud-discoveryengine/1.4.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [1.3.3](/php/docs/reference/cloud-discoveryengine/1.3.3/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [1.2.0](/php/docs/reference/cloud-discoveryengine/1.2.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [1.1.0](/php/docs/reference/cloud-discoveryengine/1.1.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [1.0.0](/php/docs/reference/cloud-discoveryengine/1.0.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.11.3](/php/docs/reference/cloud-discoveryengine/0.11.3/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.8.0](/php/docs/reference/cloud-discoveryengine/0.8.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.7.1](/php/docs/reference/cloud-discoveryengine/0.7.1/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.6.0](/php/docs/reference/cloud-discoveryengine/0.6.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.5.0](/php/docs/reference/cloud-discoveryengine/0.5.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.4.0](/php/docs/reference/cloud-discoveryengine/0.4.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.3.0](/php/docs/reference/cloud-discoveryengine/0.3.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.2.0](/php/docs/reference/cloud-discoveryengine/0.2.0/V1.SearchRequest.ContentSearchSpec.SnippetSpec)\n- [0.1.1](/php/docs/reference/cloud-discoveryengine/0.1.1/V1.SearchRequest.ContentSearchSpec.SnippetSpec) \nReference documentation and code samples for the Google Cloud Discovery Engine V1 Client class SnippetSpec.\n\nA specification for configuring snippets in a search response.\n\nGenerated from protobuf message `google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DiscoveryEngine \\\\ V1 \\\\ SearchRequest \\\\ ContentSearchSpec\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getMaxSnippetCount\n\n\\[DEPRECATED\\] This field is deprecated. To control snippet return, use\n`return_snippet` field. For backwards compatibility, we will return\nsnippet if max_snippet_count \\\u003e 0.\n\n### setMaxSnippetCount\n\n\\[DEPRECATED\\] This field is deprecated. To control snippet return, use\n`return_snippet` field. For backwards compatibility, we will return\nsnippet if max_snippet_count \\\u003e 0.\n\n### getReferenceOnly\n\n\\[DEPRECATED\\] This field is deprecated and will have no affect on the\nsnippet.\n\n### setReferenceOnly\n\n\\[DEPRECATED\\] This field is deprecated and will have no affect on the\nsnippet.\n\n### getReturnSnippet\n\nIf `true`, then return snippet. If no snippet can be generated, we\nreturn \"No snippet is available for this page.\" A `snippet_status` with\n`SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.\n\n### setReturnSnippet\n\nIf `true`, then return snippet. If no snippet can be generated, we\nreturn \"No snippet is available for this page.\" A `snippet_status` with\n`SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned."]]