Google Cloud Retail V2 Client - Class CompletionResult (1.0.1)

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

Resource that represents completion results.

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

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ suggestion string

The suggestion for the query.

↳ attributes array|Google\Protobuf\Internal\MapField

Custom attributes for the suggestion term. * For "user-data", the attributes are additional custom attributes ingested through BigQuery. * For "cloud-retail", the attributes are product attributes generated by Cloud Retail. It requires UserEvent.product_details is imported properly.

getSuggestion

The suggestion for the query.

Generated from protobuf field string suggestion = 1;

Returns
TypeDescription
string

setSuggestion

The suggestion for the query.

Generated from protobuf field string suggestion = 1;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getAttributes

Custom attributes for the suggestion term.

  • For "user-data", the attributes are additional custom attributes ingested through BigQuery.
  • For "cloud-retail", the attributes are product attributes generated by Cloud Retail. It requires UserEvent.product_details is imported properly.

Generated from protobuf field map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2;

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setAttributes

Custom attributes for the suggestion term.

  • For "user-data", the attributes are additional custom attributes ingested through BigQuery.
  • For "cloud-retail", the attributes are product attributes generated by Cloud Retail. It requires UserEvent.product_details is imported properly.

Generated from protobuf field map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 2;

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this