# Google Cloud Discovery Engine V1 Client - Class ChunkSpec (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 ChunkSpec.

Specifies the chunk spec to be returned from the search response.

Only available if the
[SearchRequest.ContentSearchSpec.search_result_mode](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchRequest.ContentSearchSpec#_Google_Cloud_DiscoveryEngine_V1_SearchRequest_ContentSearchSpec__getSearchResultMode__)
is set to
[CHUNKS](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchRequest.ContentSearchSpec.SearchResultMode#_Google_Cloud_DiscoveryEngine_V1_SearchRequest_ContentSearchSpec_SearchResultMode__CHUNKS)

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

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ num_previous_chunks` | `int` The number of previous chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no previous chunks will be returned. |
| `↳ num_next_chunks` | `int` The number of next chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no next chunks will be returned. |

### getNumPreviousChunks

The number of previous chunks to be returned of the current chunk. The
maximum allowed value is 3.

If not specified, no previous chunks will be returned.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setNumPreviousChunks

The number of previous chunks to be returned of the current chunk. The
maximum allowed value is 3.

If not specified, no previous chunks will be returned.

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

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

### getNumNextChunks

The number of next chunks to be returned of the current chunk. The
maximum allowed value is 3.

If not specified, no next chunks will be returned.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setNumNextChunks

The number of next chunks to be returned of the current chunk. The
maximum allowed value is 3.

If not specified, no next chunks will be returned.

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

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