Google Cloud Retail V2 Client - Class CompleteQueryResponse (1.0.1)

Reference documentation and code samples for the Google Cloud Retail V2 Client class CompleteQueryResponse.

Response of the auto-complete query.

Generated from protobuf message google.cloud.retail.v2.CompleteQueryResponse

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ completion_results array<Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult>

Results of the matching suggestions. The result list is ordered and the first result is top suggestion.

↳ attribution_token string

A unique complete token. This should be included in the UserEvent.completion_detail for search events resulting from this completion, which enables accurate attribution of complete model performance.

↳ recent_search_results array<Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>

Matched recent searches of this user. The maximum number of recent searches is 10. This field is a restricted feature. Contact Retail Search support team if you are interested in enabling it. This feature is only available when CompleteQueryRequest.visitor_id field is set and UserEvent is imported. The recent searches satisfy the follow rules: * They are ordered from latest to oldest. * They are matched with CompleteQueryRequest.query case insensitively. * They are transformed to lower case. * They are UTF-8 safe. Recent searches are deduplicated. More recent searches will be reserved when duplication happens.

getCompletionResults

Results of the matching suggestions. The result list is ordered and the first result is top suggestion.

Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setCompletionResults

Results of the matching suggestions. The result list is ordered and the first result is top suggestion.

Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.CompletionResult completion_results = 1;

Parameter
NameDescription
var array<Google\Cloud\Retail\V2\CompleteQueryResponse\CompletionResult>
Returns
TypeDescription
$this

getAttributionToken

A unique complete token. This should be included in the UserEvent.completion_detail for search events resulting from this completion, which enables accurate attribution of complete model performance.

Generated from protobuf field string attribution_token = 2;

Returns
TypeDescription
string

setAttributionToken

A unique complete token. This should be included in the UserEvent.completion_detail for search events resulting from this completion, which enables accurate attribution of complete model performance.

Generated from protobuf field string attribution_token = 2;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRecentSearchResults

Matched recent searches of this user. The maximum number of recent searches is 10. This field is a restricted feature. Contact Retail Search support team if you are interested in enabling it.

This feature is only available when CompleteQueryRequest.visitor_id field is set and UserEvent is imported. The recent searches satisfy the follow rules:

  • They are ordered from latest to oldest.
  • They are matched with CompleteQueryRequest.query case insensitively.
  • They are transformed to lower case.
  • They are UTF-8 safe. Recent searches are deduplicated. More recent searches will be reserved when duplication happens.

Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setRecentSearchResults

Matched recent searches of this user. The maximum number of recent searches is 10. This field is a restricted feature. Contact Retail Search support team if you are interested in enabling it.

This feature is only available when CompleteQueryRequest.visitor_id field is set and UserEvent is imported. The recent searches satisfy the follow rules:

  • They are ordered from latest to oldest.
  • They are matched with CompleteQueryRequest.query case insensitively.
  • They are transformed to lower case.
  • They are UTF-8 safe. Recent searches are deduplicated. More recent searches will be reserved when duplication happens.

Generated from protobuf field repeated .google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult recent_search_results = 3;

Parameter
NameDescription
var array<Google\Cloud\Retail\V2\CompleteQueryResponse\RecentSearchResult>
Returns
TypeDescription
$this