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

Search parameters.

Generated from protobuf message `google.cloud.retail.v2.ConversationalSearchRequest.SearchParams`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ ConversationalSearchRequest

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ filter` | `string` Optional. The filter string to restrict search results. The syntax of the filter string is the same as [SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__). |
| `↳ canonical_filter` | `string` Optional. The canonical filter string to restrict search results. The syntax of the canonical filter string is the same as [SearchRequest.canonical_filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getCanonicalFilter__). |
| `↳ sort_by` | `string` Optional. The sort string to specify the sorting of search results. The syntax of the sort string is the same as SearchRequest.sort. |
| `↳ boost_spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.BoostSpec` Optional. The boost spec to specify the boosting of search results. The syntax of the boost spec is the same as [SearchRequest.boost_spec](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getBoostSpec__). |

### getFilter

Optional. The filter string to restrict search results.

The syntax of the filter string is the same as
[SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__).

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

### setFilter

Optional. The filter string to restrict search results.

The syntax of the filter string is the same as
[SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__).

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

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

### getCanonicalFilter

Optional. The canonical filter string to restrict search results.

The syntax of the canonical filter string is the same as
[SearchRequest.canonical_filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getCanonicalFilter__).

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

### setCanonicalFilter

Optional. The canonical filter string to restrict search results.

The syntax of the canonical filter string is the same as
[SearchRequest.canonical_filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getCanonicalFilter__).

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

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

### getSortBy

Optional. The sort string to specify the sorting of search results.

The syntax of the sort string is the same as
SearchRequest.sort.

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

### setSortBy

Optional. The sort string to specify the sorting of search results.

The syntax of the sort string is the same as
SearchRequest.sort.

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

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

### getBoostSpec

Optional. The boost spec to specify the boosting of search results.

The syntax of the boost spec is the same as
[SearchRequest.boost_spec](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getBoostSpec__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.BoostSpec|null` |   |

### hasBoostSpec

### clearBoostSpec

### setBoostSpec

Optional. The boost spec to specify the boosting of search results.

The syntax of the boost spec is the same as
[SearchRequest.boost_spec](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getBoostSpec__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.BoostSpec` |

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