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 messagegoogle.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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Discovery Engine V1 Client - Class CompletionSuggestion (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/php/docs/reference/cloud-discoveryengine/latest/V1.CompletionSuggestion)\n- [1.6.1](/php/docs/reference/cloud-discoveryengine/1.6.1/V1.CompletionSuggestion)\n- [1.5.1](/php/docs/reference/cloud-discoveryengine/1.5.1/V1.CompletionSuggestion)\n- [1.4.0](/php/docs/reference/cloud-discoveryengine/1.4.0/V1.CompletionSuggestion)\n- [1.3.3](/php/docs/reference/cloud-discoveryengine/1.3.3/V1.CompletionSuggestion)\n- [1.2.0](/php/docs/reference/cloud-discoveryengine/1.2.0/V1.CompletionSuggestion)\n- [1.1.0](/php/docs/reference/cloud-discoveryengine/1.1.0/V1.CompletionSuggestion)\n- [1.0.0](/php/docs/reference/cloud-discoveryengine/1.0.0/V1.CompletionSuggestion)\n- [0.11.3](/php/docs/reference/cloud-discoveryengine/0.11.3/V1.CompletionSuggestion)\n- [0.8.0](/php/docs/reference/cloud-discoveryengine/0.8.0/V1.CompletionSuggestion)\n- [0.7.1](/php/docs/reference/cloud-discoveryengine/0.7.1/V1.CompletionSuggestion)\n- [0.6.0](/php/docs/reference/cloud-discoveryengine/0.6.0/V1.CompletionSuggestion)\n- [0.5.0](/php/docs/reference/cloud-discoveryengine/0.5.0/V1.CompletionSuggestion)\n- [0.4.0](/php/docs/reference/cloud-discoveryengine/0.4.0/V1.CompletionSuggestion)\n- [0.3.0](/php/docs/reference/cloud-discoveryengine/0.3.0/V1.CompletionSuggestion)\n- [0.2.0](/php/docs/reference/cloud-discoveryengine/0.2.0/V1.CompletionSuggestion)\n- [0.1.1](/php/docs/reference/cloud-discoveryengine/0.1.1/V1.CompletionSuggestion) \nReference documentation and code samples for the Google Cloud Discovery Engine V1 Client class CompletionSuggestion.\n\nAutocomplete suggestions that are imported from Customer.\n\nGenerated from protobuf message `google.cloud.discoveryengine.v1.CompletionSuggestion`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DiscoveryEngine \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getGlobalScore\n\nGlobal score of this suggestion. Control how this suggestion would be\nscored / ranked.\n\n### hasGlobalScore\n\n### setGlobalScore\n\nGlobal score of this suggestion. Control how this suggestion would be\nscored / ranked.\n\n### getFrequency\n\nFrequency of this suggestion. Will be used to rank suggestions when score\nis not available.\n\n### hasFrequency\n\n### setFrequency\n\nFrequency of this suggestion. Will be used to rank suggestions when score\nis not available.\n\n### getSuggestion\n\nRequired. The suggestion text.\n\n### setSuggestion\n\nRequired. The suggestion text.\n\n### getLanguageCode\n\nBCP-47 language code of this suggestion.\n\n### setLanguageCode\n\nBCP-47 language code of this suggestion.\n\n### getGroupId\n\nIf two suggestions have the same groupId, they will not be\nreturned together. Instead the one ranked higher will be returned. This can\nbe used to deduplicate semantically identical suggestions.\n\n### setGroupId\n\nIf two suggestions have the same groupId, they will not be\nreturned together. Instead the one ranked higher will be returned. This can\nbe used to deduplicate semantically identical suggestions.\n\n### getGroupScore\n\nThe score of this suggestion within its group.\n\n### setGroupScore\n\nThe score of this suggestion within its group.\n\n### getAlternativePhrases\n\nAlternative matching phrases for this suggestion.\n\n### setAlternativePhrases\n\nAlternative matching phrases for this suggestion.\n\n### getRankingInfo"]]