Google Cloud Retail V2 Client - Class ConversationalSearchResult (2.1.0)

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 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 is dress and next SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer is red color, which does not match any product attribute value filters, the refined query will be dress, red color.

↳ additional_filters array<Google\Cloud\Retail\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<Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer>

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

↳ additional_filter Google\Cloud\Retail\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, 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 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 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 is dress and next SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer 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 is dress and next SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer 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
Google\Protobuf\Internal\RepeatedField

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<Google\Cloud\Retail\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
Google\Protobuf\Internal\RepeatedField

setSuggestedAnswers

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

Parameter
Name Description
var array<Google\Cloud\Retail\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, and use the merged filter in the follow up search request.

Returns
Type Description
Google\Cloud\Retail\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, and use the merged filter in the follow up search request.

Parameter
Name Description
var Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter
Returns
Type Description
$this