# Google Cloud Retail V2 Client - Class ReplacementAction (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 ReplacementAction.

Replaces a term in the query. Multiple replacement candidates can be
specified. All `query_terms` will be replaced with the replacement term.

Example: Replace "gShoe" with "google shoe".

Generated from protobuf message `google.cloud.retail.v2.Rule.ReplacementAction`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ Rule

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ query_terms` | `string[]` Terms from the search query. Will be replaced by replacement term. Can specify up to 100 terms. |
| `↳ replacement_term` | `string` Term that will be used for replacement. |
| `↳ term` | `string` Will be \[deprecated = true\] post migration; |

### getQueryTerms

Terms from the search query.

Will be replaced by replacement term.
Can specify up to 100 terms.

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

### setQueryTerms

Terms from the search query.

Will be replaced by replacement term.
Can specify up to 100 terms.

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

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

### getReplacementTerm

Term that will be used for replacement.

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

### setReplacementTerm

Term that will be used for replacement.

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

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

### getTerm

Will be \[deprecated = true\] post migration;

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

### setTerm

Will be \[deprecated = true\] post migration;

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

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