Google Cloud Discovery Engine V1 Client - Class CompletionSuggestion (1.2.0)

Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class CompletionSuggestion.

Autocomplete suggestions that are imported from Customer.

Generated from protobuf message google.cloud.discoveryengine.v1.CompletionSuggestion

Namespace

Google \ Cloud \ DiscoveryEngine \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ global_score float

Global score of this suggestion. Control how this suggestion would be scored / ranked.

↳ frequency int|string

Frequency of this suggestion. Will be used to rank suggestions when score is not available.

↳ suggestion string

Required. The suggestion text.

↳ language_code string

BCP-47 language code of this suggestion.

↳ group_id string

If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.

↳ group_score float

The score of this suggestion within its group.

↳ alternative_phrases array

Alternative matching phrases for this suggestion.

getGlobalScore

Global score of this suggestion. Control how this suggestion would be scored / ranked.

Returns
Type Description
float

hasGlobalScore

setGlobalScore

Global score of this suggestion. Control how this suggestion would be scored / ranked.

Parameter
Name Description
var float
Returns
Type Description
$this

getFrequency

Frequency of this suggestion. Will be used to rank suggestions when score is not available.

Returns
Type Description
int|string

hasFrequency

setFrequency

Frequency of this suggestion. Will be used to rank suggestions when score is not available.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getSuggestion

Required. The suggestion text.

Returns
Type Description
string

setSuggestion

Required. The suggestion text.

Parameter
Name Description
var string
Returns
Type Description
$this

getLanguageCode

BCP-47 language code of this suggestion.

Returns
Type Description
string

setLanguageCode

BCP-47 language code of this suggestion.

Parameter
Name Description
var string
Returns
Type Description
$this

getGroupId

If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.

Returns
Type Description
string

setGroupId

If two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.

Parameter
Name Description
var string
Returns
Type Description
$this

getGroupScore

The score of this suggestion within its group.

Returns
Type Description
float

setGroupScore

The score of this suggestion within its group.

Parameter
Name Description
var float
Returns
Type Description
$this

getAlternativePhrases

Alternative matching phrases for this suggestion.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setAlternativePhrases

Alternative matching phrases for this suggestion.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getRankingInfo

Returns
Type Description
string