# Google Cloud Discovery Engine V1 Client - Class SnippetSpec (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class SnippetSpec.

A specification for configuring snippets in a search response.

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

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ SearchRequest \\ ContentSearchSpec

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ max_snippet_count` | `int` \[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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |