A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes".
Required. The human readable control display name. Used in Retail UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown.
↳ associated_serving_config_ids
array
Output only. List ofserving configids that are associated with this control in the sameCatalog. Note the association is managed via theServingConfig, this is an output only denormalized view.
↳ solution_types
array
Required. Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time. OnlySOLUTION_TYPE_SEARCHvalue is supported at the moment. If no solution type is provided at creation time, will default toSOLUTION_TYPE_SEARCH.
↳ search_solution_use_case
array
Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default toSEARCH_SOLUTION_USE_CASE_SEARCHif not specified. Currently only allow one search_solution_use_case per control.
getRule
A rule control - a condition-action pair.
Enacts a set action when the condition is triggered.
For example: Boost "gShoe" when query full matches "Running Shoes".
Output only. List ofserving configids that are associated with this control in the sameCatalog.
Note the association is managed via theServingConfig, this is an output
only denormalized view.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getSolutionTypes
Required. Immutable. The solution types that the control is used for.
Currently we support setting only one type of solution at creation time.
OnlySOLUTION_TYPE_SEARCHvalue is supported at the moment.
If no solution type is provided at creation time, will default toSOLUTION_TYPE_SEARCH.
Required. Immutable. The solution types that the control is used for.
Currently we support setting only one type of solution at creation time.
OnlySOLUTION_TYPE_SEARCHvalue is supported at the moment.
If no solution type is provided at creation time, will default toSOLUTION_TYPE_SEARCH.
Parameter
Name
Description
var
int[]
Returns
Type
Description
$this
getSearchSolutionUseCase
Specifies the use case for the control.
Affects what condition fields can be set.
Only settable by search controls.
Will default toSEARCH_SOLUTION_USE_CASE_SEARCHif not specified. Currently only allow one search_solution_use_case per
control.
Affects what condition fields can be set.
Only settable by search controls.
Will default toSEARCH_SOLUTION_USE_CASE_SEARCHif not specified. Currently only allow one search_solution_use_case per
control.
[[["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 Retail V2 Client - Class Control (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.Control)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.Control)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.Control)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.Control)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.Control)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.Control)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.Control)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.Control)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.Control)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.Control)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.Control)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.Control)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.Control) \nReference documentation and code samples for the Google Cloud Retail V2 Client class Control.\n\nConfigures dynamic metadata that can be linked to a\n[ServingConfig](/php/docs/reference/cloud-retail/latest/V2.ServingConfig) and affect search or\nrecommendation results at serving time.\n\nGenerated from protobuf message `google.cloud.retail.v2.Control`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getRule\n\nA rule control - a condition-action pair.\n\nEnacts a set action when the condition is triggered.\nFor example: Boost \"gShoe\" when query full matches \"Running Shoes\".\n\n### hasRule\n\n### setRule\n\nA rule control - a condition-action pair.\n\nEnacts a set action when the condition is triggered.\nFor example: Boost \"gShoe\" when query full matches \"Running Shoes\".\n\n### getName\n\nImmutable. Fully qualified name\n`projects/*/locations/global/catalogs/*/controls/*`\n\n### setName\n\nImmutable. Fully qualified name\n`projects/*/locations/global/catalogs/*/controls/*`\n\n### getDisplayName\n\nRequired. The human readable control display name. Used in Retail UI.\n\nThis field must be a UTF-8 encoded string with a length limit of 128\ncharacters. Otherwise, an INVALID_ARGUMENT error is thrown.\n\n### setDisplayName\n\nRequired. The human readable control display name. Used in Retail UI.\n\nThis field must be a UTF-8 encoded string with a length limit of 128\ncharacters. Otherwise, an INVALID_ARGUMENT error is thrown.\n\n### getAssociatedServingConfigIds\n\nOutput only. List of [serving config](/php/docs/reference/cloud-retail/latest/V2.ServingConfig)\nids that are associated with this control in the same\n[Catalog](/php/docs/reference/cloud-retail/latest/V2.Catalog).\n\nNote the association is managed via the\n[ServingConfig](/php/docs/reference/cloud-retail/latest/V2.ServingConfig), this is an output\nonly denormalized view.\n\n### setAssociatedServingConfigIds\n\nOutput only. List of [serving config](/php/docs/reference/cloud-retail/latest/V2.ServingConfig)\nids that are associated with this control in the same\n[Catalog](/php/docs/reference/cloud-retail/latest/V2.Catalog).\n\nNote the association is managed via the\n[ServingConfig](/php/docs/reference/cloud-retail/latest/V2.ServingConfig), this is an output\nonly denormalized view.\n\n### getSolutionTypes\n\nRequired. Immutable. The solution types that the control is used for.\n\nCurrently we support setting only one type of solution at creation time.\nOnly `SOLUTION_TYPE_SEARCH` value is supported at the moment.\nIf no solution type is provided at creation time, will default to\n[SOLUTION_TYPE_SEARCH](/php/docs/reference/cloud-retail/latest/V2.SolutionType#_Google_Cloud_Retail_V2_SolutionType__SOLUTION_TYPE_SEARCH).\n\n### setSolutionTypes\n\nRequired. Immutable. The solution types that the control is used for.\n\nCurrently we support setting only one type of solution at creation time.\nOnly `SOLUTION_TYPE_SEARCH` value is supported at the moment.\nIf no solution type is provided at creation time, will default to\n[SOLUTION_TYPE_SEARCH](/php/docs/reference/cloud-retail/latest/V2.SolutionType#_Google_Cloud_Retail_V2_SolutionType__SOLUTION_TYPE_SEARCH).\n\n### getSearchSolutionUseCase\n\nSpecifies the use case for the control.\n\nAffects what condition fields can be set.\nOnly settable by search controls.\nWill default to\n[SEARCH_SOLUTION_USE_CASE_SEARCH](/php/docs/reference/cloud-retail/latest/V2.SearchSolutionUseCase#_Google_Cloud_Retail_V2_SearchSolutionUseCase__SEARCH_SOLUTION_USE_CASE_SEARCH)\nif not specified. Currently only allow one search_solution_use_case per\ncontrol.\n\n### setSearchSolutionUseCase\n\nSpecifies the use case for the control.\n\nAffects what condition fields can be set.\nOnly settable by search controls.\nWill default to\n[SEARCH_SOLUTION_USE_CASE_SEARCH](/php/docs/reference/cloud-retail/latest/V2.SearchSolutionUseCase#_Google_Cloud_Retail_V2_SearchSolutionUseCase__SEARCH_SOLUTION_USE_CASE_SEARCH)\nif not specified. Currently only allow one search_solution_use_case per\ncontrol.\n\n### getControl"]]