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

Message to be used for grounding with Vertex AI Search.

Generated from protobuf message `google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSource`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ GenerateGroundedContentRequest \\ GroundingSource

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ serving_config` | `string` The resource name of the Engine to use. Format: `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` |
| `↳ max_result_count` | `int` Number of search results to return. The default value is 10. The maximumm allowed value is 10. |
| `↳ filter` | `string` Filter expression to be applied to the search. The syntax is the same as [SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchRequest#_Google_Cloud_DiscoveryEngine_V1_SearchRequest__getFilter__). |
| `↳ safe_search` | `bool` If set, safe search is enabled in Vertex AI Search requests. |

### getServingConfig

The resource name of the Engine to use.

Format:
`projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setServingConfig

The resource name of the Engine to use.

Format:
`projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}`

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

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

### getMaxResultCount

Number of search results to return.

The default value is 10. The maximumm allowed value is 10.

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

### setMaxResultCount

Number of search results to return.

The default value is 10. The maximumm allowed value is 10.

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

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

### getFilter

Filter expression to be applied to the search.

The syntax is the same as
[SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchRequest#_Google_Cloud_DiscoveryEngine_V1_SearchRequest__getFilter__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFilter

Filter expression to be applied to the search.

The syntax is the same as
[SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchRequest#_Google_Cloud_DiscoveryEngine_V1_SearchRequest__getFilter__).

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

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

### getSafeSearch

If set, safe search is enabled in Vertex AI Search requests.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setSafeSearch

If set, safe search is enabled in Vertex AI Search requests.

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

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