Reference documentation and code samples for the Google Cloud Retail V2 Client class Condition.
Metadata that is used to define a condition that triggers an action.
A valid condition must specify at least one of 'query_terms' or
'products_filter'. If multiple fields are specified, the condition is met if
all the fields are satisfied e.g. if a set of query terms and product_filter
are set, then only items matching the product_filter for requests with a
query matching the query terms wil get boosted.
Generated from protobuf message google.cloud.retail.v2.Condition
A list (up to 10 entries) of terms to match the query on. If not specified, match all queries. If many query terms are specified, the condition is matched if any of the terms is a match (i.e. using the OR operator).
[[["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-08-28 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class Condition (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.Condition)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.Condition)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.Condition)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.Condition)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.Condition)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.Condition)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.Condition)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.Condition)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.Condition)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.Condition)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.Condition)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.Condition)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.Condition) \nReference documentation and code samples for the Google Cloud Retail V2 Client class Condition.\n\nMetadata that is used to define a condition that triggers an action.\n\nA valid condition must specify at least one of 'query_terms' or\n'products_filter'. If multiple fields are specified, the condition is met if\nall the fields are satisfied e.g. if a set of query terms and product_filter\nare set, then only items matching the product_filter for requests with a\nquery matching the query terms wil get boosted.\n\nGenerated from protobuf message `google.cloud.retail.v2.Condition`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getQueryTerms\n\nA list (up to 10 entries) of terms to match the query on. If not\nspecified, match all queries.\n\nIf many query terms are specified, the condition\nis matched if any of the terms is a match (i.e. using the OR operator).\n\n### setQueryTerms\n\nA list (up to 10 entries) of terms to match the query on. If not\nspecified, match all queries.\n\nIf many query terms are specified, the condition\nis matched if any of the terms is a match (i.e. using the OR operator).\n\n### getActiveTimeRange\n\nRange of time(s) specifying when Condition is active.\n\nCondition true if any time range matches.\n\n### setActiveTimeRange\n\nRange of time(s) specifying when Condition is active.\n\nCondition true if any time range matches.\n\n### getPageCategories\n\nUsed to support browse uses cases.\n\nA list (up to 10 entries) of categories or departments.\nThe format should be the same as\n[UserEvent.page_categories](/php/docs/reference/cloud-retail/latest/V2.UserEvent#_Google_Cloud_Retail_V2_UserEvent__getPageCategories__);\n\n### setPageCategories\n\nUsed to support browse uses cases.\n\nA list (up to 10 entries) of categories or departments.\nThe format should be the same as\n[UserEvent.page_categories](/php/docs/reference/cloud-retail/latest/V2.UserEvent#_Google_Cloud_Retail_V2_UserEvent__getPageCategories__);"]]