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

This field specifies all related information that is needed on client
side for UI rendering of conversational retail search.

Generated from protobuf message `google.cloud.retail.v2.SearchResponse.ConversationalSearchResult`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ SearchResponse

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ conversation_id` | `string` Conversation UUID. This field will be stored in client side storage to maintain the conversation session with server and will be used for next search request's [SearchRequest.ConversationalSearchSpec.conversation_id](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.ConversationalSearchSpec#_Google_Cloud_Retail_V2_SearchRequest_ConversationalSearchSpec__getConversationId__) to restore conversation state in server. |
| `↳ refined_query` | `string` The current refined query for the conversational search. This field will be used in customer UI that the query in the search bar should be replaced with the refined query. For example, if [SearchRequest.query](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getQuery__) is `dress` and next [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.ConversationalSearchSpec.UserAnswer#_Google_Cloud_Retail_V2_SearchRequest_ConversationalSearchSpec_UserAnswer__getTextAnswer__) is `red color`, which does not match any product attribute value filters, the refined query will be `dress, red color`. |
| `↳ additional_filters` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.ConversationalSearchResult.AdditionalFilter>` This field is deprecated but will be kept for backward compatibility. There is expected to have only one additional filter and the value will be the same to the same as field `additional_filter`. |
| `↳ followup_question` | `string` The follow-up question. e.g., `What is the color?` |
| `↳ suggested_answers` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.ConversationalSearchResult.SuggestedAnswer>` The answer options provided to client for the follow-up question. |
| `↳ additional_filter` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.ConversationalSearchResult.AdditionalFilter` This is the incremental additional filters implied from the current user answer. User should add the suggested addition filters to the previous [SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__), and use the merged filter in the follow up search request. |

### getConversationId

Conversation UUID. This field will be stored in client side storage to
maintain the conversation session with server and will be used for next
search request's
[SearchRequest.ConversationalSearchSpec.conversation_id](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.ConversationalSearchSpec#_Google_Cloud_Retail_V2_SearchRequest_ConversationalSearchSpec__getConversationId__)
to restore conversation state in server.

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

### setConversationId

Conversation UUID. This field will be stored in client side storage to
maintain the conversation session with server and will be used for next
search request's
[SearchRequest.ConversationalSearchSpec.conversation_id](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.ConversationalSearchSpec#_Google_Cloud_Retail_V2_SearchRequest_ConversationalSearchSpec__getConversationId__)
to restore conversation state in server.

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

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

### getRefinedQuery

The current refined query for the conversational search. This field
will be used in customer UI that the query in the search bar should be
replaced with the refined query. For example, if
[SearchRequest.query](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getQuery__) is
`dress` and next
[SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.ConversationalSearchSpec.UserAnswer#_Google_Cloud_Retail_V2_SearchRequest_ConversationalSearchSpec_UserAnswer__getTextAnswer__)
is `red color`, which does not match any product attribute value filters,
the refined query will be `dress, red color`.

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

### setRefinedQuery

The current refined query for the conversational search. This field
will be used in customer UI that the query in the search bar should be
replaced with the refined query. For example, if
[SearchRequest.query](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getQuery__) is
`dress` and next
[SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.ConversationalSearchSpec.UserAnswer#_Google_Cloud_Retail_V2_SearchRequest_ConversationalSearchSpec_UserAnswer__getTextAnswer__)
is `red color`, which does not match any product attribute value filters,
the refined query will be `dress, red color`.

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

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

### getAdditionalFilters

This field is deprecated but will be kept for backward compatibility.

There is expected to have only one additional filter and the value will
be the same to the same as field `additional_filter`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.ConversationalSearchResult.AdditionalFilter>` |   |

### setAdditionalFilters

This field is deprecated but will be kept for backward compatibility.

There is expected to have only one additional filter and the value will
be the same to the same as field `additional_filter`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.ConversationalSearchResult.AdditionalFilter>` |

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

### getFollowupQuestion

The follow-up question. e.g., `What is the color?`

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

### setFollowupQuestion

The follow-up question. e.g., `What is the color?`

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

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

### getSuggestedAnswers

The answer options provided to client for the follow-up question.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.ConversationalSearchResult.SuggestedAnswer>` |   |

### setSuggestedAnswers

The answer options provided to client for the follow-up question.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchResponse.ConversationalSearchResult.SuggestedAnswer>` |

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

### getAdditionalFilter

This is the incremental additional filters implied from the current
user answer. User should add the suggested addition filters to the
previous
[SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__), and
use the merged filter in the follow up search request.

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

### hasAdditionalFilter

### clearAdditionalFilter

### setAdditionalFilter

This is the incremental additional filters implied from the current
user answer. User should add the suggested addition filters to the
previous
[SearchRequest.filter](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__), and
use the merged filter in the follow up search request.

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

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