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

Autocomplete suggestions that are imported from Customer.

Generated from protobuf message `google.cloud.discoveryengine.v1.CompletionSuggestion`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ global_score` | `float` Global score of this suggestion. Control how this suggestion would be scored / ranked. |
| `↳ frequency` | `int|string` Frequency of this suggestion. Will be used to rank suggestions when score is not available. |
| `↳ suggestion` | `string` Required. The suggestion text. |
| `↳ language_code` | `string` BCP-47 language code of this suggestion. |
| `↳ group_id` | `string` If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions. |
| `↳ group_score` | `float` The score of this suggestion within its group. |
| `↳ alternative_phrases` | `string[]` Alternative matching phrases for this suggestion. |

### getGlobalScore

Global score of this suggestion. Control how this suggestion would be
scored / ranked.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### hasGlobalScore

### setGlobalScore

Global score of this suggestion. Control how this suggestion would be
scored / ranked.

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

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

### getFrequency

Frequency of this suggestion. Will be used to rank suggestions when score
is not available.

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

### hasFrequency

### setFrequency

Frequency of this suggestion. Will be used to rank suggestions when score
is not available.

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

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

### getSuggestion

Required. The suggestion text.

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

### setSuggestion

Required. The suggestion text.

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

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

### getLanguageCode

BCP-47 language code of this suggestion.

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

### setLanguageCode

BCP-47 language code of this suggestion.

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

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

### getGroupId

If two suggestions have the same groupId, they will not be
returned together. Instead the one ranked higher will be returned. This can
be used to deduplicate semantically identical suggestions.

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

### setGroupId

If two suggestions have the same groupId, they will not be
returned together. Instead the one ranked higher will be returned. This can
be used to deduplicate semantically identical suggestions.

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

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

### getGroupScore

The score of this suggestion within its group.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setGroupScore

The score of this suggestion within its group.

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

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

### getAlternativePhrases

Alternative matching phrases for this suggestion.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAlternativePhrases

Alternative matching phrases for this suggestion.

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

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

### getRankingInfo

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