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

Returns
TypeDescription
string

setSuggestion

The suggestion for the query.

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.
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.
Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this