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

Represents the search results.

Generated from protobuf message `google.cloud.discoveryengine.v1.SearchResponse.SearchResult`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1 \\ SearchResponse

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ id` | `string` [Document.id](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document#_Google_Cloud_DiscoveryEngine_V1_Document__getId__) of the searched [Document](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document). |
| `↳ document` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document` The document data snippet in the search response. Only fields that are marked as `retrievable` are populated. |
| `↳ chunk` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Chunk` The chunk data in the search response 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). |
| `↳ model_scores` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Output only. Google provided available scores. |
| `↳ rank_signals` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchResponse.SearchResult.RankSignals` Optional. A set of ranking signals associated with the result. |

### getId

[Document.id](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document#_Google_Cloud_DiscoveryEngine_V1_Document__getId__) of the
searched [Document](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document).

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

### setId

[Document.id](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document#_Google_Cloud_DiscoveryEngine_V1_Document__getId__) of the
searched [Document](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document).

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

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

### getDocument

The document data snippet in the search response. Only fields that are
marked as `retrievable` are populated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document|null` |   |

### hasDocument

### clearDocument

### setDocument

The document data snippet in the search response. Only fields that are
marked as `retrievable` are populated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Document` |

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

### getChunk

The chunk data in the search response 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).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Chunk|null` |   |

### hasChunk

### clearChunk

### setChunk

The chunk data in the search response 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).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Chunk` |

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

### getModelScores

Output only. Google provided available scores.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setModelScores

Output only. Google provided available scores.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getRankSignals

Optional. A set of ranking signals associated with the result.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchResponse.SearchResult.RankSignals|null` |   |

### hasRankSignals

### clearRankSignals

### setRankSignals

Optional. A set of ranking signals associated with the result.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.SearchResponse.SearchResult.RankSignals` |

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