# Google Cloud Retail V2 Client - Class CompletionResult (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class CompletionResult.

Resource that represents completion results.

Generated from protobuf message `google.cloud.retail.v2.CompleteQueryResponse.CompletionResult`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ CompleteQueryResponse

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ suggestion` | `string` The suggestion for the query. |
| `↳ attributes` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Custom attributes for the suggestion term. \* \* For `user-data`, the attributes are additional custom attributes ingested through BigQuery. \* \* For `cloud-retail`, the attributes are product attributes generated by Cloud Retail. It requires [UserEvent.product_details](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.UserEvent#_Google_Cloud_Retail_V2_UserEvent__getProductDetails__) is imported properly. |

### getSuggestion

The suggestion for the query.

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

### setSuggestion

The suggestion for the query.

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

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

### getAttributes

Custom attributes for the suggestion term.

- For `user-data`, the attributes are additional custom attributes ingested through BigQuery.
- For `cloud-retail`, the attributes are product attributes generated by Cloud Retail. It requires [UserEvent.product_details](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.UserEvent#_Google_Cloud_Retail_V2_UserEvent__getProductDetails__) is imported properly.

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

### setAttributes

Custom attributes for the suggestion term.

- For `user-data`, the attributes are additional custom attributes ingested through BigQuery.
- For `cloud-retail`, the attributes are product attributes generated by Cloud Retail. It requires [UserEvent.product_details](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.UserEvent#_Google_Cloud_Retail_V2_UserEvent__getProductDetails__) is imported properly.

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

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